myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarinsc...@apache.org
Subject svn commit: r419086 - in /myfaces: core/trunk/impl/src/main/java/org/apache/myfaces/config/ core/trunk/impl/src/main/java/org/apache/myfaces/webapp/ shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/ tomahawk/trunk/examples/blank/src/main/...
Date Tue, 04 Jul 2006 20:31:27 GMT
Author: mmarinschek
Date: Tue Jul  4 13:31:26 2006
New Revision: 419086

URL: http://svn.apache.org/viewvc?rev=419086&view=rev
Log:
fixed lowercase context attributes (lowercase is still allowed for those parameters -->
backward compatibility)

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigValidator.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/StateUtils.java
    myfaces/tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/web.xml
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/web.xml
    myfaces/tomahawk/trunk/examples/tiles/src/main/webapp/WEB-INF/web.xml

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigValidator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigValidator.java?rev=419086&r1=419085&r2=419086&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigValidator.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigValidator.java
Tue Jul  4 13:31:26 2006
@@ -34,7 +34,7 @@
 public class FacesConfigValidator
 {
 
-    public static final String VALIDATE_CONTEXT_PARAM = "org.apache.myfaces.validate";
+    public static final String VALIDATE_CONTEXT_PARAM = "org.apache.myfaces.VALIDATE";
     
     private FacesConfigValidator(){
         // hidden 

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java?rev=419086&r1=419085&r2=419086&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java
Tue Jul  4 13:31:26 2006
@@ -69,7 +69,8 @@
                 new FacesConfigurator(externalContext).configure();
 
                 if ("true".equals(servletContext
-                                .getInitParameter(FacesConfigValidator.VALIDATE_CONTEXT_PARAM)))
+                                .getInitParameter(FacesConfigValidator.VALIDATE_CONTEXT_PARAM))
|| "true".equals(servletContext
+                                .getInitParameter(FacesConfigValidator.VALIDATE_CONTEXT_PARAM.toLowerCase())))
                 {
                     List list = FacesConfigValidator.validate(externalContext,
                             servletContext.getRealPath("/"));

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/StateUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/StateUtils.java?rev=419086&r1=419085&r2=419086&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/StateUtils.java
(original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/StateUtils.java
Tue Jul  4 13:31:26 2006
@@ -50,7 +50,7 @@
  * </ul>
  *
  * <p>To enable encryption, a secret must be provided.  StateUtils looks first
- * for the <i>org.apache.myfaces.secret</i> init param.
+ * for the <i>org.apache.myfaces.SECRET</i> init param.
  * If a secret cannot be located, encryption is not used.</p>
  *
  * <ul>
@@ -58,15 +58,15 @@
  * <li>ECB is the default mode</li>
  * <li>PKCS5Padding is the default padding</li>
  * <li>The default algorithm can be overridden using the
- * <i>org.apache.myfaces.algorithm</i> parameter</li>
+ * <i>org.apache.myfaces.ALGORITHM</i> parameter</li>
  * <li>The default mode and padding can be overridden using the
- * <i>org.apache.myfaces.algorithm.parameters</i> parameter</li>
+ * <i>org.apache.myfaces.algorithm.PARAMETERS</i> parameter</li>
  * <li>SecretKey cacheing can be disabled using the 
- * <i>org.apache.myfaces.secret.cache</i> parameter</li>
+ * <i>org.apache.myfaces.secret.CACHE</i> parameter</li>
  * <li>The defaults are not recommended</li>
  * <li>This utility has not been tested with modes other than ECB and CBC</li>
  * <li>An initialization vector can be specified via the
- * <i>org.apache.myfaces.algorithm.parameters</i> parameter</li>
+ * <i>org.apache.myfaces.algorithm.PARAMETERS</i> parameter</li>
  * </ul>
  *
  * <p>All parameters are interpretted as base 64 encoded keys.  In other
@@ -96,11 +96,11 @@
     public static final String DEFAULT_ALGORITHM_PARAMS = "ECB/PKCS5Padding";
 
     public static final String INIT_PREFIX = "org.apache.myfaces.";
-    public static final String INIT_SECRET = INIT_PREFIX + "secret";
-    public static final String INIT_ALGORITHM = INIT_PREFIX + "algorithm";
-    public static final String INIT_SECRET_KEY_CACHE = INIT_PREFIX + "secret.cache";
-    public static final String INIT_ALGORITHM_IV = INIT_PREFIX + "algorithm.iv";
-    public static final String INIT_ALGORITHM_PARAM = INIT_PREFIX + "algorithm.parameters";
+    public static final String INIT_SECRET = INIT_PREFIX + "SECRET";
+    public static final String INIT_ALGORITHM = INIT_PREFIX + "ALGORITHM";
+    public static final String INIT_SECRET_KEY_CACHE = INIT_PREFIX + "secret.CACHE";
+    public static final String INIT_ALGORITHM_IV = INIT_PREFIX + "algorithm.IV";
+    public static final String INIT_ALGORITHM_PARAM = INIT_PREFIX + "algorithm.PARAMETERS";
     
     public static final String SERIAL_FACTORY = INIT_PREFIX + "SERIAL_FACTORY";
     
@@ -139,14 +139,14 @@
     	if(ctx == null)
     		throw new NullPointerException("ExternalContext ctx");
     	
-        return ctx.getInitParameter(INIT_SECRET) != null;
+        return ctx.getInitParameter(INIT_SECRET) != null || ctx.getInitParameter(INIT_SECRET.toLowerCase())!=null;
     }
 
     /**
      * This fires during the Render Response phase.
      */
 
-    public static final String construct(Object object, ExternalContext ctx){
+    public static String construct(Object object, ExternalContext ctx){
         byte[] bytes = getAsByteArray(object, ctx);
         if( enableCompression(ctx) )
             	bytes = compress(bytes);
@@ -163,7 +163,7 @@
         }
     }
 
-    public static final byte[] getAsByteArray(Object object, ExternalContext ctx)
+    public static byte[] getAsByteArray(Object object, ExternalContext ctx)
     {
     	ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
         
@@ -198,7 +198,7 @@
     	
     }
 
-    public static final byte[] compress(byte[] bytes)
+    public static byte[] compress(byte[] bytes)
     {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try
@@ -219,7 +219,7 @@
         }
     }
 
-    public static final byte[] encode(byte[] bytes)
+    public static byte[] encode(byte[] bytes)
     {
     	  return new Base64().encode(bytes);
     }
@@ -228,7 +228,7 @@
      * This fires during the Restore View phase.
      */
 
-    public static final Object reconstruct(String string, ExternalContext ctx){
+    public static Object reconstruct(String string, ExternalContext ctx){
     	byte[] bytes;
         try
         {
@@ -246,12 +246,12 @@
         }
     }
 
-    public static final byte[] decode(byte[] bytes)
+    public static byte[] decode(byte[] bytes)
     {
     	  return new Base64().decode(bytes);
     }
 
-    public static final byte[] decompress(byte[] bytes)
+    public static byte[] decompress(byte[] bytes)
     {
     	ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
     	ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -288,7 +288,7 @@
 
     }
 
-    public static final Object getAsObject(byte[] bytes, ExternalContext ctx)
+    public static Object getAsObject(byte[] bytes, ExternalContext ctx)
     {
     	ByteArrayInputStream input = new ByteArrayInputStream(bytes);
 
@@ -397,11 +397,36 @@
             throw new NullPointerException("ExternalContext ctx");
 
         String _secret = ctx.getInitParameter(INIT_SECRET);
+        if(_secret == null)
+        {
+            _secret = ctx.getInitParameter(INIT_SECRET.toLowerCase());
+        }
         String _algorithm = ctx.getInitParameter(INIT_ALGORITHM);
+        if(_algorithm == null)
+        {
+            _algorithm = ctx.getInitParameter(INIT_ALGORITHM.toLowerCase());
+        }
         String _algorithmParams = ctx.getInitParameter(INIT_ALGORITHM_PARAM);
+
+        if(_algorithmParams == null)
+        {
+            _algorithmParams = ctx.getInitParameter(INIT_ALGORITHM_PARAM.toLowerCase());
+        }
+
         String _iv = ctx.getInitParameter(INIT_ALGORITHM_IV);
+
+        if(_iv == null)
+        {
+            _iv = ctx.getInitParameter(INIT_ALGORITHM_IV.toLowerCase());
+        }
+
         String _cache = ctx.getInitParameter(INIT_SECRET_KEY_CACHE);
 
+        if(_cache == null)
+        {
+            _cache = ctx.getInitParameter(INIT_SECRET_KEY_CACHE.toLowerCase());
+        }
+
         // use isSecure() before calling this method
         if (_secret == null)
             throw new NullPointerException("secret for " + INIT_SECRET
@@ -448,6 +473,11 @@
         }else{
             
             Object object = ctx.getApplicationMap().get(INIT_SECRET_KEY_CACHE);
+
+            if(object == null)
+            {
+                object = ctx.getApplicationMap().get(INIT_SECRET_KEY_CACHE.toLowerCase());
+            }
             
             if( object == null )
                 throw new NullPointerException("The context parameter '" 
@@ -486,12 +516,28 @@
             throw new NullPointerException("ServletContext ctx");
         
         String cache = ctx.getInitParameter(INIT_SECRET_KEY_CACHE);
+
+        if(cache == null)
+        {
+            cache = ctx.getInitParameter(INIT_SECRET_KEY_CACHE.toLowerCase());
+        }
         
         if("false".equals(cache))
             return;
         
         String _secret = ctx.getInitParameter(INIT_SECRET);
+
+        if(_secret == null)
+        {
+            _secret = ctx.getInitParameter(INIT_SECRET.toLowerCase());
+        }
+
         String _algorithm = ctx.getInitParameter(INIT_ALGORITHM);
+
+        if(_algorithm == null)
+        {
+            _algorithm = ctx.getInitParameter(INIT_ALGORITHM.toLowerCase());
+        }
         
         if (_algorithm == null)
         {

Modified: myfaces/tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/web.xml?rev=419086&r1=419085&r2=419086&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/web.xml Tue Jul  4 13:31:26
2006
@@ -76,7 +76,7 @@
     		state saving.  See MyFaces wiki/web site documentation for instructions
     		on how to configure an application for diffenent encryption strengths.
     	</description>
-        <param-name>org.apache.myfaces.secret</param-name>
+        <param-name>org.apache.myfaces.SECRET</param-name>
         <param-value>NzY1NDMyMTA=</param-value>
     </context-param>
     
@@ -84,7 +84,7 @@
   		<description>
   			Validate managed beans and navigation rules.
   		</description>
-       	<param-name>org.apache.myfaces.validate</param-name>
+       	<param-name>org.apache.myfaces.VALIDATE</param-name>
        	<param-value>true</param-value>
     </context-param>
 

Modified: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/web.xml?rev=419086&r1=419085&r2=419086&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/web.xml Tue Jul  4 13:31:26
2006
@@ -75,7 +75,7 @@
   		<description>
   			Validate managed beans and navigation rules.
   		</description>
-       	<param-name>org.apache.myfaces.validate</param-name>
+       	<param-name>org.apache.myfaces.VALIDATE</param-name>
        	<param-value>true</param-value>
     </context-param>
 

Modified: myfaces/tomahawk/trunk/examples/tiles/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/tiles/src/main/webapp/WEB-INF/web.xml?rev=419086&r1=419085&r2=419086&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/tiles/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tomahawk/trunk/examples/tiles/src/main/webapp/WEB-INF/web.xml Tue Jul  4 13:31:26
2006
@@ -76,7 +76,7 @@
     		state saving.  See MyFaces wiki/web site documentation for instructions
     		on how to configure an application for diffenent encryption strengths.
     	</description>
-        <param-name>org.apache.myfaces.secret</param-name>
+        <param-name>org.apache.myfaces.SECRET</param-name>
         <param-value>NzY1NDMyMTA=</param-value>
     </context-param>
   
@@ -84,7 +84,7 @@
   		<description>
   			Validate managed beans and navigation rules.
   		</description>
-       	<param-name>org.apache.myfaces.validate</param-name>
+       	<param-name>org.apache.myfaces.VALIDATE</param-name>
        	<param-value>true</param-value>
     </context-param>  
   



Mime
View raw message