myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r427657 [4/42] - in /myfaces: core/trunk/api/src/main/java/javax/faces/component/ core/trunk/api/src/test/java/javax/faces/ core/trunk/api/src/test/java/javax/faces/application/ core/trunk/api/src/test/java/javax/faces/component/ core/trunk...
Date Tue, 01 Aug 2006 17:44:01 GMT
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java Tue Aug  1 10:43:28 2006
@@ -1,111 +1,111 @@
-package org.apache.myfaces.shared.util;
-
-import org.apache.myfaces.shared.component.BindingAware;
-import org.apache.commons.digester.Digester;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.faces.context.FacesContext;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIInput;
-import javax.faces.el.ValueBinding;
-import java.util.Iterator;
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * @author Martin Marinschek (latest modification by $Author: grantsmith $)
- * @version $Revision: 169655 $ $Date: 2005-05-11 18:45:06 +0200 (Mi, 11 Mai 2005) $
- */
-public class RestoreStateUtils
-{
-    private static Log log = LogFactory.getLog(RestoreStateUtils.class);
-
-    /**
-     * Walk the component tree, executing any component-bindings to reattach
-     * components to their backing beans. Also, any UIInput component is
-     * marked as Valid.
-     * <p>
-     *  Note that this method effectively breaks encapsulation; instead of
-     *  asking each component to update itself and its children, this
-     * method just reaches into each component. That makes it impossible
-     * for any component to customise its behaviour at this point.
-     * <p>
-     * This has been filed as an issue against the spec. Until this
-     * issue is resolved, we'll add a new marker-interface for components
-     * to allow them to define their interest in handling children bindings themselves.
-     */
-    public static void recursivelyHandleComponentReferencesAndSetValid(FacesContext facesContext,
-                                                                       UIComponent parent)
-    {
-        recursivelyHandleComponentReferencesAndSetValid(facesContext, parent, false);
-    }
-
-    public static void recursivelyHandleComponentReferencesAndSetValid(FacesContext facesContext,
-                                                                       UIComponent parent, boolean forceHandle)
-    {
-        Method handleBindingsMethod = getBindingMethod(parent);
-
-        if(handleBindingsMethod!=null && !forceHandle)
-        {
-            try
-            {
-                handleBindingsMethod.invoke(parent,new Object[]{});
-            }
-            catch (Throwable th)
-            {
-                log.error("Exception while invoking handleBindings on component with client-id:"
-                        +parent.getClientId(facesContext),th);
-            }
-        }
-        else
-        {
-            for (Iterator it = parent.getFacetsAndChildren(); it.hasNext(); )
-            {
-                UIComponent component = (UIComponent)it.next();
-
-                ValueBinding binding = component.getValueBinding("binding");    //TODO: constant
-                if (binding != null && !binding.isReadOnly(facesContext))
-                {
-                    binding.setValue(facesContext, component);
-                }
-
-                if (component instanceof UIInput)
-                {
-                    ((UIInput)component).setValid(true);
-                }
-
-                recursivelyHandleComponentReferencesAndSetValid(facesContext, component);
-            }
-        }
-    }
-
-    /**This is all a hack to work around a spec-bug which will be fixed in JSF2.0
-     *
-     * @param parent
-     * @return true if this component is bindingAware (e.g. aliasBean)
-     */
-    private static Method getBindingMethod(UIComponent parent)
-    {
-        Class[] clazzes = parent.getClass().getInterfaces();
-
-        for (int i = 0; i < clazzes.length; i++)
-        {
-            Class clazz = clazzes[i];
-
-            if(clazz.getName().indexOf("BindingAware")!=-1)
-            {
-                try
-                {
-                    return  parent.getClass().getMethod("handleBindings",new Class[]{});
-                }
-                catch (NoSuchMethodException e)
-                {
-                    // return
-                }
-            }
-        }
-
-        return null;
-    }
-}
+package org.apache.myfaces.shared.util;
+
+import org.apache.myfaces.shared.component.BindingAware;
+import org.apache.commons.digester.Digester;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
+import javax.faces.el.ValueBinding;
+import java.util.Iterator;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: grantsmith $)
+ * @version $Revision: 169655 $ $Date: 2005-05-11 18:45:06 +0200 (Mi, 11 Mai 2005) $
+ */
+public class RestoreStateUtils
+{
+    private static Log log = LogFactory.getLog(RestoreStateUtils.class);
+
+    /**
+     * Walk the component tree, executing any component-bindings to reattach
+     * components to their backing beans. Also, any UIInput component is
+     * marked as Valid.
+     * <p>
+     *  Note that this method effectively breaks encapsulation; instead of
+     *  asking each component to update itself and its children, this
+     * method just reaches into each component. That makes it impossible
+     * for any component to customise its behaviour at this point.
+     * <p>
+     * This has been filed as an issue against the spec. Until this
+     * issue is resolved, we'll add a new marker-interface for components
+     * to allow them to define their interest in handling children bindings themselves.
+     */
+    public static void recursivelyHandleComponentReferencesAndSetValid(FacesContext facesContext,
+                                                                       UIComponent parent)
+    {
+        recursivelyHandleComponentReferencesAndSetValid(facesContext, parent, false);
+    }
+
+    public static void recursivelyHandleComponentReferencesAndSetValid(FacesContext facesContext,
+                                                                       UIComponent parent, boolean forceHandle)
+    {
+        Method handleBindingsMethod = getBindingMethod(parent);
+
+        if(handleBindingsMethod!=null && !forceHandle)
+        {
+            try
+            {
+                handleBindingsMethod.invoke(parent,new Object[]{});
+            }
+            catch (Throwable th)
+            {
+                log.error("Exception while invoking handleBindings on component with client-id:"
+                        +parent.getClientId(facesContext),th);
+            }
+        }
+        else
+        {
+            for (Iterator it = parent.getFacetsAndChildren(); it.hasNext(); )
+            {
+                UIComponent component = (UIComponent)it.next();
+
+                ValueBinding binding = component.getValueBinding("binding");    //TODO: constant
+                if (binding != null && !binding.isReadOnly(facesContext))
+                {
+                    binding.setValue(facesContext, component);
+                }
+
+                if (component instanceof UIInput)
+                {
+                    ((UIInput)component).setValid(true);
+                }
+
+                recursivelyHandleComponentReferencesAndSetValid(facesContext, component);
+            }
+        }
+    }
+
+    /**This is all a hack to work around a spec-bug which will be fixed in JSF2.0
+     *
+     * @param parent
+     * @return true if this component is bindingAware (e.g. aliasBean)
+     */
+    private static Method getBindingMethod(UIComponent parent)
+    {
+        Class[] clazzes = parent.getClass().getInterfaces();
+
+        for (int i = 0; i < clazzes.length; i++)
+        {
+            Class clazz = clazzes[i];
+
+            if(clazz.getName().indexOf("BindingAware")!=-1)
+            {
+                try
+                {
+                    return  parent.getClass().getMethod("handleBindings",new Class[]{});
+                }
+                catch (NoSuchMethodException e)
+                {
+                    // return
+                }
+            }
+        }
+
+        return null;
+    }
+}

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java
------------------------------------------------------------------------------
    svn:eol-style = native

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=427657&r1=427656&r2=427657&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 Aug  1 10:43:28 2006
@@ -1,568 +1,568 @@
-/*
- * Copyright 2004-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.shared.util;
-
-import org.apache.myfaces.shared.util.serial.SerialFactory;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
-import javax.faces.FacesException;
-import javax.faces.context.ExternalContext;
-import javax.servlet.ServletContext;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
-
-/**
- * <p>This Class exposes a handful of methods related to encryption,
- * compression and serialization.</p>
- *
- * <ul>
- * <li>ISO-8859-1 is the character set used.</li>
- * <li>GZIP is used for all compression/decompression.</li>
- * <li>Base64 is used for all encoding and decoding.</li>
- * </ul>
- *
- * <p>To enable encryption, a secret must be provided.  StateUtils looks first
- * for the <i>org.apache.myfaces.SECRET</i> init param.
- * If a secret cannot be located, encryption is not used.</p>
- *
- * <ul>
- * <li>DES is the default encryption algorithm</li>
- * <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>
- * <li>The default mode and padding can be overridden using the
- * <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>
- * <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>
- * </ul>
- *
- * <p>All parameters are interpretted as base 64 encoded keys.  In other
- * words, if your secret is "76543210", you would put "NzY1NDMyMTA=" in
- * the deployment descriptor.  This is needed so that key values are not
- * limited to just values composed of printable characters.</p>
- *
- * <p>If you are using CBC mode encryption, you <b>must</b> specify an
- * initialization vector.  StateUtils will throw an exception otherwise.</p>
- *
- * <p>If you are using the AES algorithm and getting a SecurityException
- * complaining about keysize, you most likely need to get the unlimited
- * strength jurisdiction policy files from a place like
- * http://java.sun.com/j2se/1.4.2/download.html .</p>
- *
- * @author Dennis C. Byrne, ich
- * @see org.apache.myfaces.webapp.StartupServletContextListener
- * @noinspection UnusedAssignment
- */
-
-public final class StateUtils {
-
-    private static final Log log = LogFactory.getLog(StateUtils.class);
-
-    public static final String ZIP_CHARSET = "ISO-8859-1";
-
-    public static final String DEFAULT_ALGORITHM = "DES";
-    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 SERIAL_FACTORY = INIT_PREFIX + "SERIAL_FACTORY";
-    
-    private static final String COMPRESS_STATE_IN_CLIENT = INIT_PREFIX + "COMPRESS_STATE_IN_CLIENT";
-    
-    /** Utility class, do not instatiate */
-    private StateUtils()
-    {
-    	//nope
-    }
-
-    private static void testConfiguration(String algorithmParams, String iv){
-
-        if (algorithmParams != null && algorithmParams.startsWith("CBC") )
-        {
-        	if(iv == null)
-        		throw new FacesException(INIT_ALGORITHM_PARAM +
-                                    " parameter has been set with CBC mode," +
-                                    " but no initialization vector has been set " +
-                                    " with " + INIT_ALGORITHM_IV);
-        }
-
-    }
-    
-    public static boolean enableCompression(ExternalContext ctx)
-    {
-        if(ctx == null)
-            throw new NullPointerException("ExternalContext ctx");
-    
-        return "true".equals(ctx.getInitParameter(COMPRESS_STATE_IN_CLIENT));
-    }
-    
-    public static boolean isSecure(ExternalContext ctx)
-    {
-    	
-    	if(ctx == null)
-    		throw new NullPointerException("ExternalContext ctx");
-    	
-        return ctx.getInitParameter(INIT_SECRET) != null || ctx.getInitParameter(INIT_SECRET.toLowerCase())!=null;
-    }
-
-    /**
-     * This fires during the Render Response phase.
-     */
-
-    public static String construct(Object object, ExternalContext ctx){
-        byte[] bytes = getAsByteArray(object, ctx);
-        if( enableCompression(ctx) )
-            	bytes = compress(bytes);
-        if(isSecure(ctx))
-                bytes = encrypt(bytes, ctx);
-        bytes = encode(bytes);
-        try
-        {
-            return new String(bytes, ZIP_CHARSET);
-        }
-        catch (UnsupportedEncodingException e)
-        {
-            throw new FacesException(e);
-        }
-    }
-
-    public static byte[] getAsByteArray(Object object, ExternalContext ctx)
-    {
-    	ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        
-        // get the Factory that was instantiated @ startup
-        SerialFactory serialFactory = (SerialFactory) ctx.getApplicationMap().get(SERIAL_FACTORY);
-        
-        if(serialFactory == null)
-            throw new NullPointerException("serialFactory");
-        
-        try
-        {
-            ObjectOutputStream writer = serialFactory.getObjectOutputStream(outputStream);
-            //new ObjectOutputStream(outputStream);
-            writer.writeObject(object);
-            byte[] bytes = outputStream.toByteArray();
-            writer.close();
-            outputStream.close();
-            writer = null;
-            outputStream = null;
-            return bytes;
-        }
-        catch (IOException e)
-        {
-            throw new FacesException(e);
-        }
-    }
-
-    public static byte[] encrypt(byte[] insecure, ExternalContext ctx)
-    {
-    	
-    	return symmetric(insecure, ctx, Cipher.ENCRYPT_MODE);
-    	
-    }
-
-    public static byte[] compress(byte[] bytes)
-    {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        try
-        {
-            GZIPOutputStream gzip = new GZIPOutputStream(baos);
-            gzip.write(bytes, 0, bytes.length);
-            gzip.finish();
-            byte[] fewerBytes = baos.toByteArray();
-            gzip.close();
-            baos.close();
-            gzip = null;
-            baos = null;
-            return fewerBytes;
-        }
-        catch (IOException e)
-        {
-            throw new FacesException(e);
-        }
-    }
-
-    public static byte[] encode(byte[] bytes)
-    {
-    	  return new Base64().encode(bytes);
-    }
-
-    /**
-     * This fires during the Restore View phase.
-     */
-
-    public static Object reconstruct(String string, ExternalContext ctx){
-    	byte[] bytes;
-        try
-        {
-            bytes = string.getBytes(ZIP_CHARSET);
-            bytes = decode(bytes);
-            if(isSecure(ctx))
-                bytes = decrypt(bytes, ctx);
-            if( enableCompression(ctx) )
-                bytes = decompress(bytes);
-            return getAsObject(bytes, ctx);
-        }
-        catch (UnsupportedEncodingException e)
-        {
-            throw new FacesException(e);
-        }
-    }
-
-    public static byte[] decode(byte[] bytes)
-    {
-    	  return new Base64().decode(bytes);
-    }
-
-    public static byte[] decompress(byte[] bytes)
-    {
-    	ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
-    	ByteArrayOutputStream baos = new ByteArrayOutputStream();
-    	byte[] buffer = new byte[2048];
-        int length;
-
-        try
-        {
-            GZIPInputStream gis = new GZIPInputStream(bais);
-            while ((length = gis.read(buffer)) != -1)
-            {
-                baos.write(buffer, 0, length);
-            }
-
-            byte[] moreBytes = baos.toByteArray();
-            baos.close();
-            bais.close();
-            gis.close();
-            baos = null;
-            bais = null;
-            gis = null;
-            return moreBytes;
-        }
-        catch (IOException e)
-        {
-            throw new FacesException(e);
-        }
-    }
-    
-    public static byte[] decrypt(byte[] secure, ExternalContext ctx)
-    {
-    	
-    	return symmetric(secure, ctx, Cipher.DECRYPT_MODE); 
-
-    }
-
-    public static Object getAsObject(byte[] bytes, ExternalContext ctx)
-    {
-    	ByteArrayInputStream input = new ByteArrayInputStream(bytes);
-
-        // get the Factory that was instantiated @ startup
-        SerialFactory serialFactory = (SerialFactory) ctx.getApplicationMap().get(SERIAL_FACTORY);
-        
-        if(serialFactory == null)
-            throw new NullPointerException("serialFactory");
-        
-    	try
-        {
-            ObjectInputStream s = serialFactory.getObjectInputStream(input); 
-            //new MyFacesObjectInputStream(input);
-            Object object = s.readObject();
-            s.close();
-            input.close();
-            s = null;
-            input = null;
-            return object;
-        }
-        catch (Exception e)
-        {
-            throw new FacesException(e);
-        }
-    }
-
-   public static String encode64(Object obj)
-    {
-       try
-       {
-           ByteArrayOutputStream baos = new ByteArrayOutputStream();
-           OutputStream zos = new GZIPOutputStream(baos);
-           ObjectOutputStream oos = new ObjectOutputStream(zos);
-           oos.writeObject(obj);
-           oos.close();
-           zos.close();
-           baos.close();
-           Base64 base64Codec = new Base64();
-           return new String(base64Codec.encode( baos.toByteArray() ), ZIP_CHARSET);
-       }
-       catch (IOException e)
-       {
-           log.fatal("Cannot encode Object with Base64", e);
-           throw new FacesException(e);
-       }
-    }
-
-    public static void main (String[] args) throws UnsupportedEncodingException
-    {
-        byte[] bytes = encode(args[0].getBytes(ZIP_CHARSET));
-      	System.out.println(new String(bytes, ZIP_CHARSET));
-    }
-    
-    private static byte[] symmetric(byte[] data, SecretKey secretKey,
-            String algorithm, String algorithmParams, byte[] iv, int mode){
-    
-        try
-        {
-            // keep local to avoid threading issue
-            Cipher cipher = Cipher.getInstance(algorithm + "/"
-                    + algorithmParams);
-            if (iv != null)
-            {
-                IvParameterSpec ivSpec = new IvParameterSpec(iv);
-                cipher.init(mode, secretKey, ivSpec);
-            }
-            else
-            {
-                cipher.init(mode, secretKey);
-            }
-
-            if (log.isDebugEnabled())
-            {
-
-                String action = mode == Cipher.ENCRYPT_MODE ? "encrypting"
-                        : "decrypting";
-
-                log.debug(action + " w/ " + algorithm + "/" + algorithmParams);
-            }
-
-            return cipher.doFinal(data);
-        }
-        catch (Exception e)
-        {
-            throw new FacesException(e);
-        }
-    
-    }
-    
-    private static byte[] symmetric(byte[] data, byte[] secret,
-            String algorithm, String algorithmParams, byte[] iv, int mode)
-    {
-        
-        if(log.isDebugEnabled())
-            log.debug("creating new SecretKey");
-        
-        SecretKey secretKey = new SecretKeySpec(secret, algorithm);
-        return symmetric(data, secretKey, algorithm, algorithmParams, iv, mode);
-        
-    }
-
-    private static byte[] symmetric(byte[] data, ExternalContext ctx, int mode)
-    {
-
-        if (ctx == null)
-            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
-                    + " not located in deployment descriptor");
-
-        if (_algorithm == null)
-        {
-            if (log.isDebugEnabled())
-            {
-                log.debug("Using default algorithm " + DEFAULT_ALGORITHM);
-            }
-            _algorithm = DEFAULT_ALGORITHM;
-        }
-
-        if (_algorithmParams == null)
-        {
-            if (log.isDebugEnabled())
-            {
-                log.debug("Using default algorithm paramaters "
-                        + DEFAULT_ALGORITHM_PARAMS);
-            }
-            _algorithmParams = DEFAULT_ALGORITHM_PARAMS;
-        }
-
-        testConfiguration(_algorithmParams, _iv);
-
-        Base64 base64 = new Base64();
-        // TODO find a way to avoid decoding each time, maybe context listener
-
-        byte[] iv = null;
-
-        if (_iv != null)
-            iv = base64.decode(_iv.getBytes());
-
-        if(_cache != null && "false".equals(_cache)){
-            
-            // secret will have to be decoded and SecretKey will have to 
-            // be generated
-            
-            byte[] secret = base64.decode(_secret.getBytes());
-            
-            return symmetric(data, secret, _algorithm, _algorithmParams, iv, mode);
-            
-        }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 '" 
-                        + INIT_SECRET_KEY_CACHE + "' is not set to false, "
-                        + "yet there is nothing stored in the application map "
-                        + "w/ the following key '" + INIT_SECRET_KEY_CACHE + "'. "
-                        + "It was either not placed there by StartupServletContextListener "
-                        + "or something has removed it.");
-            
-            if( ! ( object instanceof SecretKey ) )
-                throw new ClassCastException("Did not find an instance of SecretKey "
-                        + "in application scope using the key '" + INIT_SECRET_KEY_CACHE + "'");
-            
-            if(log.isDebugEnabled())
-                log.debug("using cached SecretKey");
-            
-            return symmetric(data, (SecretKey)object, _algorithm, _algorithmParams, iv, mode);
-            
-        }
-        
-    }
-
-    /**
-     * Does nothing if the user has disabled the SecretKey cache. This is
-     * useful when dealing with a JCA provider whose SecretKey 
-     * implementation is not thread safe.
-     * 
-     * Instantiates a SecretKey instance based upon what the user has 
-     * specified in the deployment descriptor.  The SecretKey is then 
-     * stored in application scope where it can be used for all requests.
-     */
-    
-    public static void initSecret(ServletContext ctx){
-        
-        if(ctx == null)
-            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)
-        {
-            if (log.isDebugEnabled())
-            {
-                log.debug("Using default algorithm " + DEFAULT_ALGORITHM);
-            }
-            _algorithm = DEFAULT_ALGORITHM;
-        }
-        
-        if(_secret == null)
-            throw new NullPointerException("_secret String - '"
-                    + INIT_SECRET_KEY_CACHE + "' has been enabled, "
-                    + "but there is no '" + INIT_SECRET + "'");
-        
-        byte[] secret = new Base64().decode(_secret.getBytes());
-        
-        // you want to do this as few times as possible
-        SecretKey secretKey = new SecretKeySpec(secret, _algorithm);
-        
-        if (log.isDebugEnabled())
-            log.debug("Storing SecretKey @ " + INIT_SECRET_KEY_CACHE);
-        
-        ctx.setAttribute(INIT_SECRET_KEY_CACHE, secretKey);
-        
-    }
-}
+/*
+ * Copyright 2004-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.shared.util;
+
+import org.apache.myfaces.shared.util.serial.SerialFactory;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.servlet.ServletContext;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
+/**
+ * <p>This Class exposes a handful of methods related to encryption,
+ * compression and serialization.</p>
+ *
+ * <ul>
+ * <li>ISO-8859-1 is the character set used.</li>
+ * <li>GZIP is used for all compression/decompression.</li>
+ * <li>Base64 is used for all encoding and decoding.</li>
+ * </ul>
+ *
+ * <p>To enable encryption, a secret must be provided.  StateUtils looks first
+ * for the <i>org.apache.myfaces.SECRET</i> init param.
+ * If a secret cannot be located, encryption is not used.</p>
+ *
+ * <ul>
+ * <li>DES is the default encryption algorithm</li>
+ * <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>
+ * <li>The default mode and padding can be overridden using the
+ * <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>
+ * <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>
+ * </ul>
+ *
+ * <p>All parameters are interpretted as base 64 encoded keys.  In other
+ * words, if your secret is "76543210", you would put "NzY1NDMyMTA=" in
+ * the deployment descriptor.  This is needed so that key values are not
+ * limited to just values composed of printable characters.</p>
+ *
+ * <p>If you are using CBC mode encryption, you <b>must</b> specify an
+ * initialization vector.  StateUtils will throw an exception otherwise.</p>
+ *
+ * <p>If you are using the AES algorithm and getting a SecurityException
+ * complaining about keysize, you most likely need to get the unlimited
+ * strength jurisdiction policy files from a place like
+ * http://java.sun.com/j2se/1.4.2/download.html .</p>
+ *
+ * @author Dennis C. Byrne, ich
+ * @see org.apache.myfaces.webapp.StartupServletContextListener
+ * @noinspection UnusedAssignment
+ */
+
+public final class StateUtils {
+
+    private static final Log log = LogFactory.getLog(StateUtils.class);
+
+    public static final String ZIP_CHARSET = "ISO-8859-1";
+
+    public static final String DEFAULT_ALGORITHM = "DES";
+    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 SERIAL_FACTORY = INIT_PREFIX + "SERIAL_FACTORY";
+    
+    private static final String COMPRESS_STATE_IN_CLIENT = INIT_PREFIX + "COMPRESS_STATE_IN_CLIENT";
+    
+    /** Utility class, do not instatiate */
+    private StateUtils()
+    {
+    	//nope
+    }
+
+    private static void testConfiguration(String algorithmParams, String iv){
+
+        if (algorithmParams != null && algorithmParams.startsWith("CBC") )
+        {
+        	if(iv == null)
+        		throw new FacesException(INIT_ALGORITHM_PARAM +
+                                    " parameter has been set with CBC mode," +
+                                    " but no initialization vector has been set " +
+                                    " with " + INIT_ALGORITHM_IV);
+        }
+
+    }
+    
+    public static boolean enableCompression(ExternalContext ctx)
+    {
+        if(ctx == null)
+            throw new NullPointerException("ExternalContext ctx");
+    
+        return "true".equals(ctx.getInitParameter(COMPRESS_STATE_IN_CLIENT));
+    }
+    
+    public static boolean isSecure(ExternalContext ctx)
+    {
+    	
+    	if(ctx == null)
+    		throw new NullPointerException("ExternalContext ctx");
+    	
+        return ctx.getInitParameter(INIT_SECRET) != null || ctx.getInitParameter(INIT_SECRET.toLowerCase())!=null;
+    }
+
+    /**
+     * This fires during the Render Response phase.
+     */
+
+    public static String construct(Object object, ExternalContext ctx){
+        byte[] bytes = getAsByteArray(object, ctx);
+        if( enableCompression(ctx) )
+            	bytes = compress(bytes);
+        if(isSecure(ctx))
+                bytes = encrypt(bytes, ctx);
+        bytes = encode(bytes);
+        try
+        {
+            return new String(bytes, ZIP_CHARSET);
+        }
+        catch (UnsupportedEncodingException e)
+        {
+            throw new FacesException(e);
+        }
+    }
+
+    public static byte[] getAsByteArray(Object object, ExternalContext ctx)
+    {
+    	ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+        
+        // get the Factory that was instantiated @ startup
+        SerialFactory serialFactory = (SerialFactory) ctx.getApplicationMap().get(SERIAL_FACTORY);
+        
+        if(serialFactory == null)
+            throw new NullPointerException("serialFactory");
+        
+        try
+        {
+            ObjectOutputStream writer = serialFactory.getObjectOutputStream(outputStream);
+            //new ObjectOutputStream(outputStream);
+            writer.writeObject(object);
+            byte[] bytes = outputStream.toByteArray();
+            writer.close();
+            outputStream.close();
+            writer = null;
+            outputStream = null;
+            return bytes;
+        }
+        catch (IOException e)
+        {
+            throw new FacesException(e);
+        }
+    }
+
+    public static byte[] encrypt(byte[] insecure, ExternalContext ctx)
+    {
+    	
+    	return symmetric(insecure, ctx, Cipher.ENCRYPT_MODE);
+    	
+    }
+
+    public static byte[] compress(byte[] bytes)
+    {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        try
+        {
+            GZIPOutputStream gzip = new GZIPOutputStream(baos);
+            gzip.write(bytes, 0, bytes.length);
+            gzip.finish();
+            byte[] fewerBytes = baos.toByteArray();
+            gzip.close();
+            baos.close();
+            gzip = null;
+            baos = null;
+            return fewerBytes;
+        }
+        catch (IOException e)
+        {
+            throw new FacesException(e);
+        }
+    }
+
+    public static byte[] encode(byte[] bytes)
+    {
+    	  return new Base64().encode(bytes);
+    }
+
+    /**
+     * This fires during the Restore View phase.
+     */
+
+    public static Object reconstruct(String string, ExternalContext ctx){
+    	byte[] bytes;
+        try
+        {
+            bytes = string.getBytes(ZIP_CHARSET);
+            bytes = decode(bytes);
+            if(isSecure(ctx))
+                bytes = decrypt(bytes, ctx);
+            if( enableCompression(ctx) )
+                bytes = decompress(bytes);
+            return getAsObject(bytes, ctx);
+        }
+        catch (UnsupportedEncodingException e)
+        {
+            throw new FacesException(e);
+        }
+    }
+
+    public static byte[] decode(byte[] bytes)
+    {
+    	  return new Base64().decode(bytes);
+    }
+
+    public static byte[] decompress(byte[] bytes)
+    {
+    	ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+    	ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    	byte[] buffer = new byte[2048];
+        int length;
+
+        try
+        {
+            GZIPInputStream gis = new GZIPInputStream(bais);
+            while ((length = gis.read(buffer)) != -1)
+            {
+                baos.write(buffer, 0, length);
+            }
+
+            byte[] moreBytes = baos.toByteArray();
+            baos.close();
+            bais.close();
+            gis.close();
+            baos = null;
+            bais = null;
+            gis = null;
+            return moreBytes;
+        }
+        catch (IOException e)
+        {
+            throw new FacesException(e);
+        }
+    }
+    
+    public static byte[] decrypt(byte[] secure, ExternalContext ctx)
+    {
+    	
+    	return symmetric(secure, ctx, Cipher.DECRYPT_MODE); 
+
+    }
+
+    public static Object getAsObject(byte[] bytes, ExternalContext ctx)
+    {
+    	ByteArrayInputStream input = new ByteArrayInputStream(bytes);
+
+        // get the Factory that was instantiated @ startup
+        SerialFactory serialFactory = (SerialFactory) ctx.getApplicationMap().get(SERIAL_FACTORY);
+        
+        if(serialFactory == null)
+            throw new NullPointerException("serialFactory");
+        
+    	try
+        {
+            ObjectInputStream s = serialFactory.getObjectInputStream(input); 
+            //new MyFacesObjectInputStream(input);
+            Object object = s.readObject();
+            s.close();
+            input.close();
+            s = null;
+            input = null;
+            return object;
+        }
+        catch (Exception e)
+        {
+            throw new FacesException(e);
+        }
+    }
+
+   public static String encode64(Object obj)
+    {
+       try
+       {
+           ByteArrayOutputStream baos = new ByteArrayOutputStream();
+           OutputStream zos = new GZIPOutputStream(baos);
+           ObjectOutputStream oos = new ObjectOutputStream(zos);
+           oos.writeObject(obj);
+           oos.close();
+           zos.close();
+           baos.close();
+           Base64 base64Codec = new Base64();
+           return new String(base64Codec.encode( baos.toByteArray() ), ZIP_CHARSET);
+       }
+       catch (IOException e)
+       {
+           log.fatal("Cannot encode Object with Base64", e);
+           throw new FacesException(e);
+       }
+    }
+
+    public static void main (String[] args) throws UnsupportedEncodingException
+    {
+        byte[] bytes = encode(args[0].getBytes(ZIP_CHARSET));
+      	System.out.println(new String(bytes, ZIP_CHARSET));
+    }
+    
+    private static byte[] symmetric(byte[] data, SecretKey secretKey,
+            String algorithm, String algorithmParams, byte[] iv, int mode){
+    
+        try
+        {
+            // keep local to avoid threading issue
+            Cipher cipher = Cipher.getInstance(algorithm + "/"
+                    + algorithmParams);
+            if (iv != null)
+            {
+                IvParameterSpec ivSpec = new IvParameterSpec(iv);
+                cipher.init(mode, secretKey, ivSpec);
+            }
+            else
+            {
+                cipher.init(mode, secretKey);
+            }
+
+            if (log.isDebugEnabled())
+            {
+
+                String action = mode == Cipher.ENCRYPT_MODE ? "encrypting"
+                        : "decrypting";
+
+                log.debug(action + " w/ " + algorithm + "/" + algorithmParams);
+            }
+
+            return cipher.doFinal(data);
+        }
+        catch (Exception e)
+        {
+            throw new FacesException(e);
+        }
+    
+    }
+    
+    private static byte[] symmetric(byte[] data, byte[] secret,
+            String algorithm, String algorithmParams, byte[] iv, int mode)
+    {
+        
+        if(log.isDebugEnabled())
+            log.debug("creating new SecretKey");
+        
+        SecretKey secretKey = new SecretKeySpec(secret, algorithm);
+        return symmetric(data, secretKey, algorithm, algorithmParams, iv, mode);
+        
+    }
+
+    private static byte[] symmetric(byte[] data, ExternalContext ctx, int mode)
+    {
+
+        if (ctx == null)
+            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
+                    + " not located in deployment descriptor");
+
+        if (_algorithm == null)
+        {
+            if (log.isDebugEnabled())
+            {
+                log.debug("Using default algorithm " + DEFAULT_ALGORITHM);
+            }
+            _algorithm = DEFAULT_ALGORITHM;
+        }
+
+        if (_algorithmParams == null)
+        {
+            if (log.isDebugEnabled())
+            {
+                log.debug("Using default algorithm paramaters "
+                        + DEFAULT_ALGORITHM_PARAMS);
+            }
+            _algorithmParams = DEFAULT_ALGORITHM_PARAMS;
+        }
+
+        testConfiguration(_algorithmParams, _iv);
+
+        Base64 base64 = new Base64();
+        // TODO find a way to avoid decoding each time, maybe context listener
+
+        byte[] iv = null;
+
+        if (_iv != null)
+            iv = base64.decode(_iv.getBytes());
+
+        if(_cache != null && "false".equals(_cache)){
+            
+            // secret will have to be decoded and SecretKey will have to 
+            // be generated
+            
+            byte[] secret = base64.decode(_secret.getBytes());
+            
+            return symmetric(data, secret, _algorithm, _algorithmParams, iv, mode);
+            
+        }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 '" 
+                        + INIT_SECRET_KEY_CACHE + "' is not set to false, "
+                        + "yet there is nothing stored in the application map "
+                        + "w/ the following key '" + INIT_SECRET_KEY_CACHE + "'. "
+                        + "It was either not placed there by StartupServletContextListener "
+                        + "or something has removed it.");
+            
+            if( ! ( object instanceof SecretKey ) )
+                throw new ClassCastException("Did not find an instance of SecretKey "
+                        + "in application scope using the key '" + INIT_SECRET_KEY_CACHE + "'");
+            
+            if(log.isDebugEnabled())
+                log.debug("using cached SecretKey");
+            
+            return symmetric(data, (SecretKey)object, _algorithm, _algorithmParams, iv, mode);
+            
+        }
+        
+    }
+
+    /**
+     * Does nothing if the user has disabled the SecretKey cache. This is
+     * useful when dealing with a JCA provider whose SecretKey 
+     * implementation is not thread safe.
+     * 
+     * Instantiates a SecretKey instance based upon what the user has 
+     * specified in the deployment descriptor.  The SecretKey is then 
+     * stored in application scope where it can be used for all requests.
+     */
+    
+    public static void initSecret(ServletContext ctx){
+        
+        if(ctx == null)
+            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)
+        {
+            if (log.isDebugEnabled())
+            {
+                log.debug("Using default algorithm " + DEFAULT_ALGORITHM);
+            }
+            _algorithm = DEFAULT_ALGORITHM;
+        }
+        
+        if(_secret == null)
+            throw new NullPointerException("_secret String - '"
+                    + INIT_SECRET_KEY_CACHE + "' has been enabled, "
+                    + "but there is no '" + INIT_SECRET + "'");
+        
+        byte[] secret = new Base64().decode(_secret.getBytes());
+        
+        // you want to do this as few times as possible
+        SecretKey secretKey = new SecretKeySpec(secret, _algorithm);
+        
+        if (log.isDebugEnabled())
+            log.debug("Storing SecretKey @ " + INIT_SECRET_KEY_CACHE);
+        
+        ctx.setAttribute(INIT_SECRET_KEY_CACHE, secretKey);
+        
+    }
+}

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/StateUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/ActionsMap.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/ActionsMap.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/ActionsMap.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/ActionsMap.java Tue Aug  1 10:43:28 2006
@@ -1,155 +1,155 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.shared.util.el;
-
-import java.util.*;
-
-/**
- * @author Sylvain Vieujot (latest modification by $Author: skitching $)
- * @version $Revision: 355303 $ $Date: 2005-12-09 02:36:08 +0100 (Fr, 09 Dez 2005) $
- *
- * You can use this class to trigger an action when a boolean is set to true.
- *
- * Example : in JSF pages, for dataTable, to remove elements :
- * Backing bean (#{inboxFace}).
- * public ActionsMap getRemoveEmailUnid(){
- * 		return new ActionsMap(){
- *			public void performAction(String unid) {
- *				InboxMailDAO<TInboxMail> dao = getInboxMailDAO();
- *				TInboxMail email = dao.getByPrimaryKey( unid );
- *				dao.remove( email );
- *			}
- *		};
- *	}
- * JSF page :
- * &lt;h:selectBooleanCheckbox value="#{inboxFace.removeEmailUnid[email.unid]}"/&gt;
- */
-public abstract class ActionsMap implements Map {
-
-    private Set keys;
-
-    public ActionsMap(){
-        // NoOp
-    }
-
-    public ActionsMap(Set keys){
-        this.keys = keys;
-    }
-
-    /**
-     * This method should fire the command.
-     */
-    public abstract void performAction(String command);
-
-    public int size() {
-        return keys.size();
-    }
-
-    public boolean isEmpty() {
-        return keys.isEmpty();
-    }
-
-    public boolean containsKey(Object key) {
-        return keys.contains( key );
-    }
-
-    public boolean containsValue(Object value) {
-        if( ! (value instanceof Boolean) )
-            return false;
-        return ((Boolean)value).booleanValue();
-    }
-
-    public Object get( Object key) {
-        return Boolean.FALSE;
-    }
-
-    public Boolean put(String key, Boolean value) {
-        if( value!=null && value.booleanValue() )
-            performAction( key );
-        return Boolean.FALSE;
-    }
-
-    public Object remove(Object key) {
-        if( keys.remove( key ) )
-            return Boolean.FALSE;
-        return null;
-    }
-
-    public void putAll(Map map) {
-        Iterator it = map.entrySet().iterator();
-
-        while (it.hasNext())
-        {
-            Entry entry = (Entry) it.next();
-            Object obj = entry.getValue();
-            if( (obj instanceof Boolean) && ((Boolean) obj).booleanValue() )
-                performAction( (String) entry.getKey() );
-        }
-    }
-
-    public void clear() {
-        keys.clear();
-    }
-
-    public Set keySet() {
-        return keys;
-    }
-
-    public Collection values() {
-        return Collections.nCopies(keys.size(), Boolean.FALSE);
-    }
-
-    public Set entrySet() {
-        Set set = new HashSet( keys.size() );
-
-        Iterator it = keys.iterator();
-
-        while (it.hasNext())
-        {
-            String command = (String) it.next();
-            set.add( new CommandEntry(command) );
-        }
-
-        return set;
-    }
-
-    private class CommandEntry implements Entry{
-
-        private final String command;
-        private boolean commandPerformed = false;
-
-        public CommandEntry(String command){
-            this.command = command;
-        }
-
-        public Object getKey() {
-            return command;
-        }
-
-        public Object getValue() {
-            return Boolean.valueOf(commandPerformed);
-        }
-
-        public Object setValue(Object performCommand) {
-            if( (performCommand instanceof Boolean) && ((Boolean)performCommand).booleanValue() ){
-                performAction( command );
-                commandPerformed = true;
-            }
-            return Boolean.valueOf(commandPerformed);
-        }
-    }
-}
-
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.shared.util.el;
+
+import java.util.*;
+
+/**
+ * @author Sylvain Vieujot (latest modification by $Author: skitching $)
+ * @version $Revision: 355303 $ $Date: 2005-12-09 02:36:08 +0100 (Fr, 09 Dez 2005) $
+ *
+ * You can use this class to trigger an action when a boolean is set to true.
+ *
+ * Example : in JSF pages, for dataTable, to remove elements :
+ * Backing bean (#{inboxFace}).
+ * public ActionsMap getRemoveEmailUnid(){
+ * 		return new ActionsMap(){
+ *			public void performAction(String unid) {
+ *				InboxMailDAO<TInboxMail> dao = getInboxMailDAO();
+ *				TInboxMail email = dao.getByPrimaryKey( unid );
+ *				dao.remove( email );
+ *			}
+ *		};
+ *	}
+ * JSF page :
+ * &lt;h:selectBooleanCheckbox value="#{inboxFace.removeEmailUnid[email.unid]}"/&gt;
+ */
+public abstract class ActionsMap implements Map {
+
+    private Set keys;
+
+    public ActionsMap(){
+        // NoOp
+    }
+
+    public ActionsMap(Set keys){
+        this.keys = keys;
+    }
+
+    /**
+     * This method should fire the command.
+     */
+    public abstract void performAction(String command);
+
+    public int size() {
+        return keys.size();
+    }
+
+    public boolean isEmpty() {
+        return keys.isEmpty();
+    }
+
+    public boolean containsKey(Object key) {
+        return keys.contains( key );
+    }
+
+    public boolean containsValue(Object value) {
+        if( ! (value instanceof Boolean) )
+            return false;
+        return ((Boolean)value).booleanValue();
+    }
+
+    public Object get( Object key) {
+        return Boolean.FALSE;
+    }
+
+    public Boolean put(String key, Boolean value) {
+        if( value!=null && value.booleanValue() )
+            performAction( key );
+        return Boolean.FALSE;
+    }
+
+    public Object remove(Object key) {
+        if( keys.remove( key ) )
+            return Boolean.FALSE;
+        return null;
+    }
+
+    public void putAll(Map map) {
+        Iterator it = map.entrySet().iterator();
+
+        while (it.hasNext())
+        {
+            Entry entry = (Entry) it.next();
+            Object obj = entry.getValue();
+            if( (obj instanceof Boolean) && ((Boolean) obj).booleanValue() )
+                performAction( (String) entry.getKey() );
+        }
+    }
+
+    public void clear() {
+        keys.clear();
+    }
+
+    public Set keySet() {
+        return keys;
+    }
+
+    public Collection values() {
+        return Collections.nCopies(keys.size(), Boolean.FALSE);
+    }
+
+    public Set entrySet() {
+        Set set = new HashSet( keys.size() );
+
+        Iterator it = keys.iterator();
+
+        while (it.hasNext())
+        {
+            String command = (String) it.next();
+            set.add( new CommandEntry(command) );
+        }
+
+        return set;
+    }
+
+    private class CommandEntry implements Entry{
+
+        private final String command;
+        private boolean commandPerformed = false;
+
+        public CommandEntry(String command){
+            this.command = command;
+        }
+
+        public Object getKey() {
+            return command;
+        }
+
+        public Object getValue() {
+            return Boolean.valueOf(commandPerformed);
+        }
+
+        public Object setValue(Object performCommand) {
+            if( (performCommand instanceof Boolean) && ((Boolean)performCommand).booleanValue() ){
+                performAction( command );
+                commandPerformed = true;
+            }
+            return Boolean.valueOf(commandPerformed);
+        }
+    }
+}
+

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/ActionsMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/GenericMap.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/GenericMap.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/GenericMap.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/GenericMap.java Tue Aug  1 10:43:28 2006
@@ -1,83 +1,83 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.shared.util.el;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.Collection;
-
-/**
- * @author Sylvain Vieujot (latest modification by $Author: skitching $)
- * @version $Revision: 355303 $ $Date: 2005-12-09 02:36:08 +0100 (Fr, 09 Dez 2005) $
- *
- */
-public abstract class GenericMap implements Map {
-
-    /**
-     * This method should return the result of the test.
-     */
-    protected abstract Object getValue(Object key);
-
-    public int size() {
-        return 1;
-    }
-
-    public boolean isEmpty() {
-        return false;
-    }
-
-    public boolean containsKey(Object key) {
-        return true;
-    }
-
-    public boolean containsValue(Object value) {
-        return value instanceof Boolean;
-    }
-
-    public Object get(Object key) {
-        return getValue(key);
-    }
-
-    public Object put(Object key, Object value) {
-        return null;
-    }
-
-    public Object remove(Object key) {
-        return null;
-    }
-
-    public void putAll(Map m) {
-        // NoOp
-    }
-
-    public void clear() {
-        // NoOp
-    }
-
-    public Set keySet() {
-        return null;
-    }
-
-    public Collection values() {
-        return null;
-    }
-
-    public Set entrySet() {
-        return null;
-    }
-}
-
-
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.shared.util.el;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.Collection;
+
+/**
+ * @author Sylvain Vieujot (latest modification by $Author: skitching $)
+ * @version $Revision: 355303 $ $Date: 2005-12-09 02:36:08 +0100 (Fr, 09 Dez 2005) $
+ *
+ */
+public abstract class GenericMap implements Map {
+
+    /**
+     * This method should return the result of the test.
+     */
+    protected abstract Object getValue(Object key);
+
+    public int size() {
+        return 1;
+    }
+
+    public boolean isEmpty() {
+        return false;
+    }
+
+    public boolean containsKey(Object key) {
+        return true;
+    }
+
+    public boolean containsValue(Object value) {
+        return value instanceof Boolean;
+    }
+
+    public Object get(Object key) {
+        return getValue(key);
+    }
+
+    public Object put(Object key, Object value) {
+        return null;
+    }
+
+    public Object remove(Object key) {
+        return null;
+    }
+
+    public void putAll(Map m) {
+        // NoOp
+    }
+
+    public void clear() {
+        // NoOp
+    }
+
+    public Set keySet() {
+        return null;
+    }
+
+    public Collection values() {
+        return null;
+    }
+
+    public Set entrySet() {
+        return null;
+    }
+}
+
+

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/GenericMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/StringMap.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/StringMap.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/StringMap.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/StringMap.java Tue Aug  1 10:43:28 2006
@@ -1,45 +1,45 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.shared.util.el;
-
-import org.apache.myfaces.shared.util.el.GenericMap;
-
-/**
- * You can use this class to perform tests.
- * Use this for example in JSF backing beans, like BaseFace.getUserInRole(String).
- *
- * @author Sylvain Vieujot (latest modification by $Author: skitching $)
- * @version $Revision: 355303 $ $Date: 2005-12-09 02:36:08 +0100 (Fr, 09 Dez 2005) $
- *
- */
-public abstract class StringMap extends GenericMap {
-
-    /**
-     * This method should return the result of the test.
-     */
-    public abstract String getString(String testKey);
-
-    public Object getValue(Object testKey){
-        return getString( (String) testKey );
-    }
-
-    public Object get(Object key) {
-        if( ! (key instanceof String) )
-            return null;
-        return getString( (String)key );
-    }
-}
-
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.shared.util.el;
+
+import org.apache.myfaces.shared.util.el.GenericMap;
+
+/**
+ * You can use this class to perform tests.
+ * Use this for example in JSF backing beans, like BaseFace.getUserInRole(String).
+ *
+ * @author Sylvain Vieujot (latest modification by $Author: skitching $)
+ * @version $Revision: 355303 $ $Date: 2005-12-09 02:36:08 +0100 (Fr, 09 Dez 2005) $
+ *
+ */
+public abstract class StringMap extends GenericMap {
+
+    /**
+     * This method should return the result of the test.
+     */
+    public abstract String getString(String testKey);
+
+    public Object getValue(Object testKey){
+        return getString( (String) testKey );
+    }
+
+    public Object get(Object key) {
+        if( ! (key instanceof String) )
+            return null;
+        return getString( (String)key );
+    }
+}
+

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/StringMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/TestsMap.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/TestsMap.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/TestsMap.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/TestsMap.java Tue Aug  1 10:43:28 2006
@@ -1,49 +1,49 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.shared.util.el;
-
-import org.apache.myfaces.shared.util.el.GenericMap;
-
-/**
- * You can use this class to perform tests.
- * Use this for example in JSF backing beans, like BaseFace.getUserInRole(String).
- *
- * @author Sylvain Vieujot (latest modification by $Author: skitching $)
- * @version $Revision: 355303 $ $Date: 2005-12-09 02:36:08 +0100 (Fr, 09 Dez 2005) $
- */
-public abstract class TestsMap extends GenericMap {
-
-    /**
-     * This method should return the result of the test.
-     */
-    public abstract boolean getTest(String testKey);
-
-    protected Object getValue(Object testKey){
-        return Boolean.valueOf(getTest( (String) testKey ));
-    }
-
-    public Object get(Object key) {
-        if( ! (key instanceof String) )
-            return null;
-        return Boolean.valueOf(getTest( (String)key ));
-    }
-
-    public Boolean put(String key, Boolean value) {
-        return Boolean.FALSE;
-    }
-}
-
-
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.shared.util.el;
+
+import org.apache.myfaces.shared.util.el.GenericMap;
+
+/**
+ * You can use this class to perform tests.
+ * Use this for example in JSF backing beans, like BaseFace.getUserInRole(String).
+ *
+ * @author Sylvain Vieujot (latest modification by $Author: skitching $)
+ * @version $Revision: 355303 $ $Date: 2005-12-09 02:36:08 +0100 (Fr, 09 Dez 2005) $
+ */
+public abstract class TestsMap extends GenericMap {
+
+    /**
+     * This method should return the result of the test.
+     */
+    public abstract boolean getTest(String testKey);
+
+    protected Object getValue(Object testKey){
+        return Boolean.valueOf(getTest( (String) testKey ));
+    }
+
+    public Object get(Object key) {
+        if( ! (key instanceof String) )
+            return null;
+        return Boolean.valueOf(getTest( (String)key ));
+    }
+
+    public Boolean put(String key, Boolean value) {
+        return Boolean.FALSE;
+    }
+}
+
+

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/el/TestsMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/serial/DefaultSerialFactory.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/serial/DefaultSerialFactory.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/serial/DefaultSerialFactory.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/serial/DefaultSerialFactory.java Tue Aug  1 10:43:28 2006
@@ -1,44 +1,44 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.shared.util.serial;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-
-import org.apache.myfaces.shared.util.MyFacesObjectInputStream;
-
-/**
- * @author Dennis C. Byrne
- */
-
-public class DefaultSerialFactory implements SerialFactory
-{
-
-    public ObjectOutputStream getObjectOutputStream(OutputStream outputStream) throws IOException
-    {
-        return new ObjectOutputStream(outputStream);
-    }
-
-    public ObjectInputStream getObjectInputStream(InputStream inputStream) throws IOException
-    {
-        return new MyFacesObjectInputStream(inputStream);
-    }
-    
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.shared.util.serial;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+
+import org.apache.myfaces.shared.util.MyFacesObjectInputStream;
+
+/**
+ * @author Dennis C. Byrne
+ */
+
+public class DefaultSerialFactory implements SerialFactory
+{
+
+    public ObjectOutputStream getObjectOutputStream(OutputStream outputStream) throws IOException
+    {
+        return new ObjectOutputStream(outputStream);
+    }
+
+    public ObjectInputStream getObjectInputStream(InputStream inputStream) throws IOException
+    {
+        return new MyFacesObjectInputStream(inputStream);
+    }
+    
+}

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/serial/DefaultSerialFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/serial/SerialFactory.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/serial/SerialFactory.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/serial/SerialFactory.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/serial/SerialFactory.java Tue Aug  1 10:43:28 2006
@@ -1,33 +1,33 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.shared.util.serial;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-
-/**
- * @author Dennis C. Byrne
- */
-
-public interface SerialFactory
-{
-    public ObjectOutputStream getObjectOutputStream(OutputStream outputStream) throws IOException;
-    public ObjectInputStream getObjectInputStream(InputStream inputStream) throws IOException;
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.shared.util.serial;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+
+/**
+ * @author Dennis C. Byrne
+ */
+
+public interface SerialFactory
+{
+    public ObjectOutputStream getObjectOutputStream(OutputStream outputStream) throws IOException;
+    public ObjectInputStream getObjectInputStream(InputStream inputStream) throws IOException;
+}

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/serial/SerialFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java Tue Aug  1 10:43:28 2006
@@ -1,60 +1,60 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-package org.apache.myfaces.shared.util.servlet;
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-import java.io.*;
-
-public class SourceCodeServlet extends HttpServlet 
-{
-    public void doGet(HttpServletRequest req, HttpServletResponse res)
-        throws IOException, ServletException
-    {
-        String webPage = req.getServletPath();
-        
-        // remove the '*.source' suffix that maps to this servlet
-        int chopPoint = webPage.indexOf(".source");
-        
-        webPage = webPage.substring(0, chopPoint - 1);
-        webPage += "p"; // replace jsf with jsp
-        
-        // get the actual file location of the requested resource
-        String realPath = getServletConfig().getServletContext().getRealPath(webPage);
-
-        // output an HTML page
-        res.setContentType("text/plain");
-
-        // print some html
-        ServletOutputStream out = res.getOutputStream();
-
-        // print the file
-        InputStream in = null;
-        try 
-        {
-            in = new BufferedInputStream(new FileInputStream(realPath));
-            int ch;
-            while ((ch = in.read()) !=-1) 
-            {
-                out.print((char)ch);
-            }
-        }
-        finally {
-            if (in != null) in.close();  // very important
-        }
-    }
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+package org.apache.myfaces.shared.util.servlet;
+
+import javax.servlet.*;
+import javax.servlet.http.*;
+import java.io.*;
+
+public class SourceCodeServlet extends HttpServlet 
+{
+    public void doGet(HttpServletRequest req, HttpServletResponse res)
+        throws IOException, ServletException
+    {
+        String webPage = req.getServletPath();
+        
+        // remove the '*.source' suffix that maps to this servlet
+        int chopPoint = webPage.indexOf(".source");
+        
+        webPage = webPage.substring(0, chopPoint - 1);
+        webPage += "p"; // replace jsf with jsp
+        
+        // get the actual file location of the requested resource
+        String realPath = getServletConfig().getServletContext().getRealPath(webPage);
+
+        // output an HTML page
+        res.setContentType("text/plain");
+
+        // print some html
+        ServletOutputStream out = res.getOutputStream();
+
+        // print the file
+        InputStream in = null;
+        try 
+        {
+            in = new BufferedInputStream(new FileInputStream(realPath));
+            int ch;
+            while ((ch = in.read()) !=-1) 
+            {
+                out.print((char)ch);
+            }
+        }
+        finally {
+            if (in != null) in.close();  // very important
+        }
+    }
+}

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/webapp/webxml/DelegatedFacesServlet.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/webapp/webxml/DelegatedFacesServlet.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/webapp/webxml/DelegatedFacesServlet.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/webapp/webxml/DelegatedFacesServlet.java Tue Aug  1 10:43:28 2006
@@ -1,20 +1,20 @@
-/*
- * Copyright 2004-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.myfaces.shared.webapp.webxml;
-
-public interface DelegatedFacesServlet
-{
-}
+/*
+ * Copyright 2004-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.shared.webapp.webxml;
+
+public interface DelegatedFacesServlet
+{
+}

Propchange: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/webapp/webxml/DelegatedFacesServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/util/AbstractStateUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/util/CachedStateUtilsAES_CBCTest.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/util/CachedStateUtilsAES_CBCTest.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/util/CachedStateUtilsAES_CBCTest.java (original)
+++ myfaces/shared/trunk/core/src/test/java/org/apache/myfaces/shared/util/CachedStateUtilsAES_CBCTest.java Tue Aug  1 10:43:28 2006
@@ -1,59 +1,59 @@
-/*
- * Copyright 2004-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.myfaces.shared.util;
-
-import junit.framework.Test;
-
-/**
- * <p>This TestCase uses the Advanced Encryption Standard with
- * Cipher Block Chaining mode and PKCS5 padding.</p>
- * <p/>
- * <p/>
- * If you are getting a SecurityException complaining about keysize,
- * you most likely need to get the unlimited strength jurisdiction
- * policy files from a place like http://java.sun.com/j2se/1.4.2/download.html .
- * </p>
- *
- * @see pom.xml <excludes>
- * @author Dennis C. Byrne
- */
-
-public class CachedStateUtilsAES_CBCTest extends AbstractStateUtilsTest
-{
-
-    public CachedStateUtilsAES_CBCTest(String name)
-    {
-        super(name);
-    }
-    
-    public static Test suite() {
-        return null; // keep this method or maven won't run it
-    }
-
-    public void setUp()
-    {
-        super.setUp();
-
-        servletContext.addInitParameter(StateUtils.INIT_SECRET, BASE64_KEY_SIZE_24);
-        servletContext.addInitParameter(StateUtils.INIT_ALGORITHM, "AES");
-        servletContext.addInitParameter(StateUtils.INIT_ALGORITHM_PARAM, "CBC/PKCS5Padding");
-        servletContext.addInitParameter(StateUtils.INIT_ALGORITHM_IV, BASE64_KEY_SIZE_16);
-        StateUtils.initSecret(servletContext);
-    }
-
-}
+/*
+ * Copyright 2004-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.myfaces.shared.util;
+
+import junit.framework.Test;
+
+/**
+ * <p>This TestCase uses the Advanced Encryption Standard with
+ * Cipher Block Chaining mode and PKCS5 padding.</p>
+ * <p/>
+ * <p/>
+ * If you are getting a SecurityException complaining about keysize,
+ * you most likely need to get the unlimited strength jurisdiction
+ * policy files from a place like http://java.sun.com/j2se/1.4.2/download.html .
+ * </p>
+ *
+ * @see pom.xml <excludes>
+ * @author Dennis C. Byrne
+ */
+
+public class CachedStateUtilsAES_CBCTest extends AbstractStateUtilsTest
+{
+
+    public CachedStateUtilsAES_CBCTest(String name)
+    {
+        super(name);
+    }
+    
+    public static Test suite() {
+        return null; // keep this method or maven won't run it
+    }
+
+    public void setUp()
+    {
+        super.setUp();
+
+        servletContext.addInitParameter(StateUtils.INIT_SECRET, BASE64_KEY_SIZE_24);
+        servletContext.addInitParameter(StateUtils.INIT_ALGORITHM, "AES");
+        servletContext.addInitParameter(StateUtils.INIT_ALGORITHM_PARAM, "CBC/PKCS5Padding");
+        servletContext.addInitParameter(StateUtils.INIT_ALGORITHM_IV, BASE64_KEY_SIZE_16);
+        StateUtils.initSecret(servletContext);
+    }
+
+}



Mime
View raw message