myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1420959 - in /myfaces/core/branches/2.2.x: ./ api/src/main/java/javax/faces/component/ api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/ impl/src/main/java/org/apache/myfaces/application/ impl/src/main/java/org/apache/myfaces...
Date Wed, 12 Dec 2012 20:45:37 GMT
Author: lu4242
Date: Wed Dec 12 20:45:33 2012
New Revision: 1420959

URL: http://svn.apache.org/viewvc?rev=1420959&view=rev
Log:
merge revisions 1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589 from trunk

Added:
    myfaces/core/branches/2.2.x/api/src/main/java/javax/faces/component/_ViewAttributeMap.java
      - copied unchanged from r1420939, myfaces/core/branches/2.1.x-client-window/api/src/main/java/javax/faces/component/_ViewAttributeMap.java
    myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIRDComponent.java
      - copied unchanged from r1420939, myfaces/core/branches/2.1.x-client-window/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/component/UIRDComponent.java
    myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingBean.java
      - copied unchanged from r1420939, myfaces/core/branches/2.1.x-client-window/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ComponentBindingBean.java
    myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ResourceDependencyBean.java
      - copied unchanged from r1420939, myfaces/core/branches/2.1.x-client-window/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/managed/ResourceDependencyBean.java
    myfaces/core/branches/2.2.x/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBinding1.xhtml
      - copied unchanged from r1420939, myfaces/core/branches/2.1.x-client-window/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/componentBinding1.xhtml
    myfaces/core/branches/2.2.x/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resourceDependency1.xhtml
      - copied unchanged from r1420939, myfaces/core/branches/2.1.x-client-window/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resourceDependency1.xhtml
    myfaces/core/branches/2.2.x/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resources/   (props changed)
      - copied from r1420939, myfaces/core/branches/2.1.x-client-window/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resources/
    myfaces/core/branches/2.2.x/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resources/custom.css
      - copied unchanged from r1420939, myfaces/core/branches/2.1.x-client-window/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resources/custom.css
Modified:
    myfaces/core/branches/2.2.x/   (props changed)
    myfaces/core/branches/2.2.x/api/src/main/java/javax/faces/component/UIViewRoot.java
    myfaces/core/branches/2.2.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheImpl.java   (props changed)
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java   (contents, props changed)
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/SessionIdGenerator.java   (props changed)
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheFactoryImpl.java   (props changed)
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheUtils.java   (props changed)
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/lifecycle/CODIClientSideWindow.java
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/lifecycle/UrlClientWindow.java
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
    myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
    myfaces/core/branches/2.2.x/impl/src/main/resources/META-INF/faces-config20.vm   (props changed)
    myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheTest.java   (props changed)
    myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheTest.java   (props changed)
    myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesTestCase.java
    myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidMyFacesRequestTestCase.java
    myfaces/core/branches/2.2.x/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/WEB-INF/testcomponent.taglib.xml
    myfaces/core/branches/2.2.x/parent/pom.xml   (props changed)
    myfaces/core/branches/2.2.x/parent/src/   (props changed)
    myfaces/core/branches/2.2.x/shared/   (props changed)
    myfaces/core/branches/2.2.x/shared-public/pom.xml   (props changed)
    myfaces/core/branches/2.2.x/shared-public/src/   (props changed)
    myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/AttachedDeltaWrapper.java   (props changed)
    myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java   (props changed)
    myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/DebugUtils.java   (props changed)
    myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/RendererUtils.java   (props changed)
    myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/TagUtils.java   (props changed)
    myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/renderkit/   (props changed)

Propchange: myfaces/core/branches/2.2.x/
------------------------------------------------------------------------------
  Merged /myfaces/core/trunk:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589
  Merged /myfaces/core/branches/2.1.x-client-window:r1410207-1420939

Modified: myfaces/core/branches/2.2.x/api/src/main/java/javax/faces/component/UIViewRoot.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/api/src/main/java/javax/faces/component/UIViewRoot.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/api/src/main/java/javax/faces/component/UIViewRoot.java (original)
+++ myfaces/core/branches/2.2.x/api/src/main/java/javax/faces/component/UIViewRoot.java Wed Dec 12 20:45:33 2012
@@ -116,6 +116,9 @@ public class UIViewRoot extends UICompon
     private static final String JAVAX_FACES_LOCATION_BODY = "javax_faces_location_body";
     private static final String JAVAX_FACES_LOCATION_FORM = "javax_faces_location_form";
     
+    private transient boolean _resourceDependencyUniqueId;
+    private transient Map<String,Object> _attributesMap;
+    
     /**
      * Construct an instance of the UIViewRoot.
      */
@@ -343,10 +346,20 @@ public class UIViewRoot extends UICompon
         // UNIQUE_ID_PREFIX, and will be unique within this UIViewRoot.
         if(seed==null)
         {
-            Long uniqueIdCounter = (Long) getStateHelper().get(PropertyKeys.uniqueIdCounter);
-            uniqueIdCounter = (uniqueIdCounter == null) ? 0 : uniqueIdCounter;
-            getStateHelper().put(PropertyKeys.uniqueIdCounter, (uniqueIdCounter+1L));
-            return bld.append(UNIQUE_ID_PREFIX).append(uniqueIdCounter).toString();    
+            if (isResourceDependencyUniqueId())
+            {
+                Long uniqueIdCounter = (Long) getStateHelper().get(PropertyKeys.resourceDependencyUniqueIdCounter);
+                uniqueIdCounter = (uniqueIdCounter == null) ? 0 : uniqueIdCounter;
+                getStateHelper().put(PropertyKeys.resourceDependencyUniqueIdCounter, (uniqueIdCounter+1L));
+                return bld.append(UNIQUE_ID_PREFIX).append("__rd_").append(uniqueIdCounter).toString();
+            }
+            else
+            {
+                Long uniqueIdCounter = (Long) getStateHelper().get(PropertyKeys.uniqueIdCounter);
+                uniqueIdCounter = (uniqueIdCounter == null) ? 0 : uniqueIdCounter;
+                getStateHelper().put(PropertyKeys.uniqueIdCounter, (uniqueIdCounter+1L));
+                return bld.append(UNIQUE_ID_PREFIX).append(uniqueIdCounter).toString();
+            }
         }
         // Optionally, a unique seed value can be supplied by component creators which
         // should be included in the generated unique id.
@@ -1234,6 +1247,32 @@ public class UIViewRoot extends UICompon
         getStateHelper().put(PropertyKeys.afterPhaseListener, afterPhaseListener);
     }
     
+    @Override
+    public Map<String, Object> getAttributes()
+    {
+        if (_attributesMap == null)
+        {
+            _attributesMap = new _ViewAttributeMap(this, super.getAttributes());
+        }
+        return _attributesMap;
+    }
+
+    /**
+     * Indicates if the component is created when facelets builds the view and
+     * is caused by the presence of a ResourceDependency annotation.
+     * 
+     * @return the _resourceDependencyUniqueId
+     */
+    boolean isResourceDependencyUniqueId()
+    {
+        return _resourceDependencyUniqueId;
+    }
+
+    void setResourceDependencyUniqueId(boolean resourceDependencyUniqueId)
+    {
+        this._resourceDependencyUniqueId = resourceDependencyUniqueId;
+    }
+    
     enum PropertyKeys
     {
          afterPhaseListener
@@ -1243,6 +1282,7 @@ public class UIViewRoot extends UICompon
         , renderKitId
         , viewId
         , uniqueIdCounter
+        , resourceDependencyUniqueIdCounter
     }
     
     @Override

Modified: myfaces/core/branches/2.2.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js (original)
+++ myfaces/core/branches/2.2.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js Wed Dec 12 20:45:33 2012
@@ -387,6 +387,35 @@ _MF_SINGLTN(_PFX_UTIL + "_Dom", Object, 
         }
     },
 
+    isFunctionNative: function(func) {
+        return /^\s*function[^{]+{\s*\[native code\]\s*}\s*$/.test(String(func));
+    },
+
+    detectAttributes: function(element) {
+        //test if 'hasAttribute' method is present and its native code is intact
+        //for example, Prototype can add its own implementation if missing
+        if (element.hasAttribute && this.isFunctionNative(element.hasAttribute)) {
+            return function(name) {
+                return element.hasAttribute(name);
+            }
+        } else {
+            try {
+                //when accessing .getAttribute method without arguments does not throw an error then the method is not available
+                element.getAttribute;
+
+                var html = element.outerHTML;
+                var startTag = html.match(/^<[^>]*>/)[0];
+                return function(name) {
+                    return startTag.indexOf(name + '=') > -1;
+                }
+            } catch (ex) {
+                return function(name) {
+                    return element.getAttribute(name);
+                }
+            }
+        }
+    },
+
     /**
      * copy all attributes from one element to another - except id
      * @param target element to copy attributes to
@@ -547,6 +576,7 @@ _MF_SINGLTN(_PFX_UTIL + "_Dom", Object, 
     },
 
     setCaretPosition:function (ctrl, pos) {
+
         if (ctrl.createTextRange) {
             var range = ctrl.createTextRange();
             range.collapse(true);
@@ -624,9 +654,6 @@ _MF_SINGLTN(_PFX_UTIL + "_Dom", Object, 
             this._removeNode(item, false);
             return null;
         }
-        // and remove the old item, in case of an empty newtag and do nothing else
-        this._removeNode(item, false);
-        return null;
     },
 
     isFunctionNative: function(func) {

Modified: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java Wed Dec 12 20:45:33 2012
@@ -104,6 +104,7 @@ import org.apache.myfaces.el.unified.res
 import org.apache.myfaces.lifecycle.LifecycleImpl;
 import org.apache.myfaces.shared.config.MyfacesConfig;
 import org.apache.myfaces.shared.util.ClassUtils;
+import org.apache.myfaces.view.facelets.FaceletCompositionContext;
 import org.apache.myfaces.view.facelets.el.ELText;
 
 /**
@@ -157,6 +158,14 @@ public class ApplicationImpl extends App
     private static final boolean LAZY_LOAD_CONFIG_OBJECTS_DEFAULT_VALUE = true;
     private Boolean _lazyLoadConfigObjects = null;
     
+    
+    /**
+     * Key under UIViewRoot to generated unique ids for components added 
+     * by @ResourceDependency effect.
+     */
+    private static final String RESOURCE_DEPENDENCY_UNIQUE_ID_KEY =
+              "oam.view.resourceDependencyUniqueId";
+
     // ~ Instance fields
     // --------------------------------------------------------------------------
     // --
@@ -1798,6 +1807,50 @@ public class ApplicationImpl extends App
             rvc.setClassProcessed(inspectedClass);
         }
     }
+
+    /**
+     * If the ResourceDependency component is created under facelets processing, it should receive
+     * an special unique component id. This method check if there is a FaceletCompositionContext
+     * and if that so, set the id. Components added by the effect of ResourceDependency are special,
+     * because they do not have state, but they depends on the view structure, so with PSS, 
+     * each time the view is built they are "recalculated", so they work as if they were transient
+     * components that needs to be created at each request, but there are some cases were the 
+     * components needs to be saved and restored fully. If a component is created outside facelets 
+     * control (render response phase) it is expected to use the default implementation of 
+     * createUniqueId(), but in that case, note that this happens after markInitialState() is 
+     * called, and the component in this case is saved and restored fully, as expected.
+     * 
+     * This code cannot be called from facelets component tag handler, because in cases where a
+     * component subtree is created using binding property, facelets lost control over component
+     * creation and delegates it to the user, but since the binding code is executed each time the
+     * view is created, the effect over ResourceDependency persists and the binding code takes into
+     * account in the recalculation step, even if later the node related to the binding property
+     * is dropped and recreated from the state fully. 
+     * 
+     * @param facesContext
+     * @param component 
+     */
+    private void setResourceIdOnFaceletsMode(FacesContext facesContext, UIComponent component)
+    {
+        if (component.getId() == null)
+        {
+            FaceletCompositionContext mctx = FaceletCompositionContext.getCurrentInstance(facesContext);
+            if (mctx != null)
+            {
+                UIViewRoot root = facesContext.getViewRoot();
+                root.getAttributes().put(RESOURCE_DEPENDENCY_UNIQUE_ID_KEY, Boolean.TRUE);
+                try
+                {
+                    String uid = root.createUniqueId(facesContext, null);
+                    component.setId(uid);
+                }
+                finally
+                {
+                    root.getAttributes().put(RESOURCE_DEPENDENCY_UNIQUE_ID_KEY, Boolean.FALSE);
+                }
+            }
+        }
+    }
     
     private void _handleAttachedResourceDependency(FacesContext context, ResourceDependency annotation)
     {
@@ -1826,6 +1879,10 @@ public class ApplicationImpl extends App
             // Call setRendererType on the UIOutput instance, passing the renderer-type.
             output.setRendererType(rendererType);
             
+            // If the @ResourceDependency was done inside facelets processing,
+            // call setId() and set a proper id from facelets
+            setResourceIdOnFaceletsMode(context, output);
+            
             // Obtain the Map of attributes from the UIOutput component by calling UIComponent.getAttributes().
             Map<String, Object> attributes = output.getAttributes();
             
@@ -2301,6 +2358,10 @@ public class ApplicationImpl extends App
 
             // Call setRendererType on the UIOutput instance, passing the renderer-type.
             output.setRendererType(rendererType);
+            
+            // If the @ResourceDependency was done inside facelets processing,
+            // call setId() and set a proper id from facelets
+            setResourceIdOnFaceletsMode(context, output);
 
             // Obtain the Map of attributes from the UIOutput component by calling UIComponent.getAttributes().
             Map<String, Object> attributes = output.getAttributes();

Modified: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java Wed Dec 12 20:45:33 2012
@@ -67,8 +67,6 @@ public class ResourceHandlerImpl extends
     //private static final Log log = LogFactory.getLog(ResourceHandlerImpl.class);
     private static final Logger log = Logger.getLogger(ResourceHandlerImpl.class.getName());
 
-    private static final int _BUFFER_SIZE = 2048;
-    
     /**
      * Allow slash in the library name of a Resource. 
      */
@@ -78,7 +76,17 @@ public class ResourceHandlerImpl extends
             "org.apache.myfaces.STRICT_JSF_2_ALLOW_SLASH_LIBRARY_NAME";
     public static final boolean INIT_PARAM_STRICT_JSF_2_ALLOW_SLASH_LIBRARY_NAME_DEFAULT = false;
     
+    /**
+     * Define the default buffer size that is used between Resource.getInputStream() and 
+     * httpServletResponse.getOutputStream() when rendering resources using the default
+     * ResourceHandler.
+     */
+    @JSFWebConfigParam(since="2.1.10, 2.0.16", defaultValue="2048", group="resources")
+    public static final String INIT_PARAM_RESOURCE_BUFFER_SIZE = "org.apache.myfaces.RESOURCE_BUFFER_SIZE";
+    private static final int INIT_PARAM_RESOURCE_BUFFER_SIZE_DEFAULT = 2048;
+    
     private Boolean _allowSlashLibraryName;
+    private int _resourceBufferSize = -1;
 
     @Override
     public Resource createResource(String resourceName)
@@ -305,7 +313,8 @@ public class ResourceHandlerImpl extends
             // ServletResponseWrapper (like ResponseSwitch).
             // Since we are handling a resource, we can expect to get an 
             // HttpServletResponse.
-            Object response = facesContext.getExternalContext().getResponse();
+            ExternalContext extContext = facesContext.getExternalContext();
+            Object response = extContext.getResponse();
             HttpServletResponse httpServletResponse = ExternalContextUtils.getHttpServletResponse(response);
             if (httpServletResponse == null)
             {
@@ -379,12 +388,16 @@ public class ResourceHandlerImpl extends
                 httpServletResponse.setHeader(entry.getKey(), entry.getValue());
             }
     
+            // Sets the preferred buffer size for the body of the response
+            extContext.setResponseBufferSize(this.getResourceBufferSize());
+            
             //serve up the bytes (taken from trinidad ResourceServlet)
             try
             {
                 InputStream in = resource.getInputStream();
                 OutputStream out = httpServletResponse.getOutputStream();
-                byte[] buffer = new byte[_BUFFER_SIZE];
+                //byte[] buffer = new byte[_BUFFER_SIZE];
+                byte[] buffer = new byte[this.getResourceBufferSize()];
     
                 try
                 {
@@ -681,4 +694,16 @@ public class ResourceHandlerImpl extends
         return _allowSlashLibraryName;
     }
 
+    protected int getResourceBufferSize()
+    {
+        if (_resourceBufferSize == -1)
+        {
+            _resourceBufferSize = WebConfigParamUtils.getIntegerInitParameter(
+                FacesContext.getCurrentInstance().getExternalContext(),
+                INIT_PARAM_RESOURCE_BUFFER_SIZE,
+                INIT_PARAM_RESOURCE_BUFFER_SIZE_DEFAULT);
+        }
+        return _resourceBufferSize;
+    }
+
 }

Propchange: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheImpl.java
------------------------------------------------------------------------------
  Merged /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheImpl.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589
  Merged /myfaces/core/branches/2.1.x-client-window/impl/src/main/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheImpl.java:r1410207-1420939

Modified: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java Wed Dec 12 20:45:33 2012
@@ -424,13 +424,9 @@ class ServerSideStateCacheImpl extends S
                     os.write(UNCOMPRESSED_FLAG);
                 }
 
-                //Object[] stateArray = (Object[]) serializedView;
-
                 ObjectOutputStream out = new ObjectOutputStream(os);
                 
                 out.writeObject(serializedView);
-                //out.writeObject(stateArray[0]);
-                //out.writeObject(stateArray[1]);
                 out.close();
                 baos.close();
 

Propchange: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java:r1410207-1420939
  Merged /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/SessionIdGenerator.java
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/impl/src/main/java/org/apache/myfaces/application/viewstate/SessionIdGenerator.java:r1410207-1420939
  Merged /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/SessionIdGenerator.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheFactoryImpl.java
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheFactoryImpl.java:r1410207-1420939
  Merged /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheFactoryImpl.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheUtils.java
------------------------------------------------------------------------------
  Merged /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheUtils.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589
  Merged /myfaces/core/branches/2.1.x-client-window/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheUtils.java:r1410207-1420939

Modified: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java Wed Dec 12 20:45:33 2012
@@ -316,7 +316,8 @@ public final class ServletExternalContex
         checkNull(url, "url");
         checkHttpServletRequest();
         String encodedUrl = ((HttpServletResponse) _servletResponse).encodeURL(url);
-        encodedUrl = encodeWindowId(encodedUrl);
+        encodedUrl = encodeURL(encodedUrl, null);
+        //encodedUrl = encodeWindowId(encodedUrl);
         return encodedUrl;
     }
     
@@ -348,7 +349,7 @@ public final class ServletExternalContex
     @Override
     public String encodeBookmarkableURL(String baseUrl, Map<String,List<String>> parameters)
     {
-        return encodeWindowId(encodeURL(baseUrl, parameters));
+        return encodeURL(baseUrl, parameters);
     }
 
     @Override
@@ -370,13 +371,15 @@ public final class ServletExternalContex
     {
         checkNull(url, "url");
         checkHttpServletRequest();
-        return encodeWindowId(((HttpServletResponse) _servletResponse).encodeURL(url));
+        //return encodeWindowId(((HttpServletResponse) _servletResponse).encodeURL(url));
+        return encodeURL(((HttpServletResponse) _servletResponse).encodeURL(url), null);
     }
 
     @Override
     public String encodeRedirectURL(String baseUrl, Map<String,List<String>> parameters)
     {
-        return encodeWindowId(_httpServletResponse.encodeRedirectURL(encodeURL(baseUrl, parameters)));
+        //return encodeWindowId(_httpServletResponse.encodeRedirectURL(encodeURL(baseUrl, parameters)));
+        return _httpServletResponse.encodeRedirectURL(encodeURL(baseUrl, parameters));
     }
 
     @Override
@@ -808,6 +811,30 @@ public final class ServletExternalContex
                 }
             }
         }
+        
+        FacesContext facesContext = FacesContext.getCurrentInstance();
+        if (ClientWindow.isClientWindowRenderModeEnabled(facesContext))
+        {
+            //TODO: Use StringBuilder or some optimization.
+            ClientWindow window = facesContext.getExternalContext().getClientWindow();
+            if (window != null)
+            {
+                Map<String, String> map = window.getQueryURLParameters(facesContext);
+                if (map != null)
+                {
+                    for (Map.Entry<String , String> entry : map.entrySet())
+                    {
+                        ArrayList<String> value = new ArrayList<String>(1);
+                        value.add(entry.getValue());
+                        if (paramMap == null)
+                        {
+                            paramMap = new HashMap<String, List<String>>();
+                        }
+                        paramMap.put(entry.getKey(), value);
+                    }
+                }
+            }
+        }        
 
         // start building the new URL
         StringBuilder newUrl = new StringBuilder(baseUrl);

Modified: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/lifecycle/CODIClientSideWindow.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/lifecycle/CODIClientSideWindow.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/lifecycle/CODIClientSideWindow.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/lifecycle/CODIClientSideWindow.java Wed Dec 12 20:45:33 2012
@@ -431,9 +431,12 @@ public class CODIClientSideWindow extend
     {
         if (queryParamsMap == null)
         {
-            queryParamsMap = new HashMap<String, String>(2,1);
-            queryParamsMap.put(ResponseStateManager.CLIENT_WINDOW_URL_PARAM, 
-                context.getExternalContext().getClientWindow().getId());
+            String id = context.getExternalContext().getClientWindow().getId();
+            if (id != null)
+            {
+                queryParamsMap = new HashMap<String, String>(2,1);
+                queryParamsMap.put(ResponseStateManager.CLIENT_WINDOW_URL_PARAM, id);
+            }
         }
         return queryParamsMap;
     }

Modified: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/lifecycle/UrlClientWindow.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/lifecycle/UrlClientWindow.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/lifecycle/UrlClientWindow.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/lifecycle/UrlClientWindow.java Wed Dec 12 20:45:33 2012
@@ -94,9 +94,12 @@ public class UrlClientWindow extends Cli
     {
         if (queryParamsMap == null)
         {
-            queryParamsMap = new HashMap<String, String>(2,1);
-            queryParamsMap.put(ResponseStateManager.CLIENT_WINDOW_URL_PARAM, 
-                context.getExternalContext().getClientWindow().getId());
+            String id = context.getExternalContext().getClientWindow().getId();
+            if (id != null)
+            {
+                queryParamsMap = new HashMap<String, String>(2,1);
+                queryParamsMap.put(ResponseStateManager.CLIENT_WINDOW_URL_PARAM, id);
+            }
         }
         return queryParamsMap;
     }

Modified: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java Wed Dec 12 20:45:33 2012
@@ -49,10 +49,8 @@ import org.apache.myfaces.shared.util.We
  */
 public class HtmlResponseStateManager extends MyfacesResponseStateManager
 {
-    //private static final Log log = LogFactory.getLog(HtmlResponseStateManager.class);
     private static final Logger log = Logger.getLogger(HtmlResponseStateManager.class.getName());
 
-    //private static final int TREE_PARAM = 2;
     private static final int STATE_PARAM = 0;
     private static final int VIEWID_PARAM = 1;
 
@@ -102,7 +100,6 @@ public class HtmlResponseStateManager ex
         
         if (isHandlingStateCachingMechanics(facesContext))
         {
-            //token = getStateCache(facesContext).saveSerializedView(facesContext, state);
             savedStateObject = getStateCache(facesContext).encodeSerializedState(facesContext, state);
         }
         else

Modified: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java Wed Dec 12 20:45:33 2012
@@ -171,6 +171,9 @@ public class DefaultFaceletsStateManagem
     private static final Set<VisitHint> VISIT_HINTS = Collections.unmodifiableSet( 
             EnumSet.of(VisitHint.SKIP_ITERATION));
     
+    private static final String UNIQUE_ID_COUNTER_KEY =
+              "oam.view.uniqueIdCounter";
+    
     private ViewDeclarationLanguageFactory _vdlFactory;
     
     private RenderKitFactory _renderKitFactory = null;
@@ -259,8 +262,16 @@ public class DefaultFaceletsStateManagem
                     {
                         view.getAttributes().put(ComponentSupport.FACELET_STATE_INSTANCE,  faceletViewState);
                     }
+                    if (state.length == 3)
+                    {
+                        if (view.getId() == null)
+                        {
+                            view.setId(view.createUniqueId(context, null));
+                        }
+                        //Jump to where the count is
+                        view.getAttributes().put(UNIQUE_ID_COUNTER_KEY, state[2]);
+                    }
                 }
-
                 // TODO: Why is necessary enable event processing?
                 // ANS: On RestoreViewExecutor, setProcessingEvents is called first to false
                 // and then to true when postback. Since we need listeners registered to PostAddToViewEvent
@@ -291,7 +302,6 @@ public class DefaultFaceletsStateManagem
             if (state != null && state[1] != null)
             {
                 states = (Map<String, Object>) state[1];
-                
                 // Visit the children and restore their state.
                 boolean emptyState = false;
                 boolean containsFaceletState = states.containsKey(
@@ -334,137 +344,9 @@ public class DefaultFaceletsStateManagem
                 {
                     view.getAttributes().put(ComponentSupport.FACELET_STATE_INSTANCE,  faceletViewState);
                 }
-                
-                // TODO: handle dynamic add/removes as mandated by the spec.  Not sure how to do handle this yet.
-                List<String> clientIdsRemoved = getClientIdsRemoved(view);
-                
-                if (clientIdsRemoved != null)
-                {
-                    Set<String> idsRemovedSet = new HashSet<String>(HashMapUtils.calcCapacity(clientIdsRemoved.size()));
-                    context.getAttributes().put(FaceletViewDeclarationLanguage.REMOVING_COMPONENTS_BUILD, Boolean.TRUE);
-                    try
-                    {
-                        // perf: clientIds are ArrayList: see method registerOnAddRemoveList(String)
-                        for (int i = 0, size = clientIdsRemoved.size(); i < size; i++)
-                        {
-                            String clientId = clientIdsRemoved.get(i);
-                            if (!idsRemovedSet.contains(clientId))
-                            {
-                                view.invokeOnComponent(context, clientId, new ContextCallback()
-                                    {
-                                        public void invokeContextCallback(FacesContext context,
-                                                UIComponent target)
-                                        {
-                                            if (target.getParent() != null)
-                                            {
-                                                if (!target.getParent().getChildren().remove(target))
-                                                {
-                                                    String key = null;
-                                                    if (target.getParent().getFacetCount() > 0)
-                                                    {
-                                                        for (Map.Entry<String, UIComponent> entry :
-                                                                target.getParent().getFacets().entrySet())
-                                                        {
-                                                            if (entry.getValue()==target)
-                                                            {
-                                                                key = entry.getKey();
-                                                                break;
-                                                            }
-                                                        }
-                                                    }
-                                                    if (key != null)
-                                                    {
-                                                        target.getParent().getFacets().remove(key);
-                                                    }
-                                                }
-                                            }
-                                        }
-                                    });
-                                idsRemovedSet.add(clientId);
-                            }
-                        }
-                        clientIdsRemoved.clear();
-                        clientIdsRemoved.addAll(idsRemovedSet);
-                    }
-                    finally
-                    {
-                        context.getAttributes().remove(FaceletViewDeclarationLanguage.REMOVING_COMPONENTS_BUILD);
-                    }
-                }
-                
-                List<String> clientIdsAdded = getClientIdsAdded(view);
-                if (clientIdsAdded != null)
-                {
-                    Set<String> idsAddedSet = new HashSet<String>(HashMapUtils.calcCapacity(clientIdsAdded.size()));
-                    // perf: clientIds are ArrayList: see method setClientsIdsAdded(String)
-                    for (int i = 0, size = clientIdsAdded.size(); i < size; i++)
-                    {
-                        String clientId = clientIdsAdded.get(i);
-                        if (!idsAddedSet.contains(clientId))
-                        {
-                            final AttachedFullStateWrapper wrapper = (AttachedFullStateWrapper) states.get(clientId);
-                            if (wrapper != null)
-                            {
-                                final Object[] addedState = (Object[]) wrapper.getWrappedStateObject(); 
-                                if (addedState != null)
-                                {
-                                    if (addedState.length == 2)
-                                    {
-                                        view = (UIViewRoot)
-                                                internalRestoreTreeStructure((TreeStructComponent) addedState[0]);
-                                        view.processRestoreState(context, addedState[1]);
-                                        break;
-                                    }
-                                    else
-                                    {
-                                        final String parentClientId = (String) addedState[0];
-                                        view.invokeOnComponent(context, parentClientId, new ContextCallback()
-                                        {
-                                            public void invokeContextCallback(FacesContext context,
-                                                    UIComponent target)
-                                            {
-                                                if (addedState[1] != null)
-                                                {
-                                                    String facetName = (String) addedState[1];
-                                                    UIComponent child
-                                                            = internalRestoreTreeStructure((TreeStructComponent)
-                                                                                           addedState[3]);
-                                                    child.processRestoreState(context, addedState[4]);
-                                                    target.getFacets().put(facetName,child);
-                                                }
-                                                else
-                                                {
-                                                    Integer childIndex = (Integer) addedState[2];
-                                                    UIComponent child
-                                                            = internalRestoreTreeStructure((TreeStructComponent)
-                                                                                           addedState[3]);
-                                                    child.processRestoreState(context, addedState[4]);
-                                                    try
-                                                    {
-                                                        target.getChildren().add(childIndex, child);
-                                                    }
-                                                    catch (IndexOutOfBoundsException e)
-                                                    {
-                                                        // We can't be sure about where should be this 
-                                                        // item, so just add it. 
-                                                        target.getChildren().add(child);
-                                                    }
-                                                }
-                                            }
-                                        });
-                                    }
-                                }
-                            }
-                            idsAddedSet.add(clientId);
-                        }
-                    }
-                    // Reset this list, because it will be calculated later when the view is being saved
-                    // in the right order, preventing duplicates (see COMPONENT_ADDED_AFTER_BUILD_VIEW for details).
-                    clientIdsAdded.clear();
-                }
+                handleDynamicAddedRemovedComponents(context, view, states);
             }
         }
-        
         // Restore binding, because UIViewRoot.processRestoreState() is never called
         //the event processing has to be enabled because of the restore view event triggers
         //TODO ask the EG the this is a spec violation if we do it that way
@@ -487,6 +369,146 @@ public class DefaultFaceletsStateManagem
         return view;
     }
     
+    public void handleDynamicAddedRemovedComponents(FacesContext context, UIViewRoot view, Map<String, Object> states)
+    {
+        List<String> clientIdsRemoved = getClientIdsRemoved(view);
+
+        if (clientIdsRemoved != null)
+        {
+            Set<String> idsRemovedSet = new HashSet<String>(HashMapUtils.calcCapacity(clientIdsRemoved.size()));
+            context.getAttributes().put(FaceletViewDeclarationLanguage.REMOVING_COMPONENTS_BUILD, Boolean.TRUE);
+            try
+            {
+                // perf: clientIds are ArrayList: see method registerOnAddRemoveList(String)
+                for (int i = 0, size = clientIdsRemoved.size(); i < size; i++)
+                {
+                    String clientId = clientIdsRemoved.get(i);
+                    if (!idsRemovedSet.contains(clientId))
+                    {
+                        view.invokeOnComponent(context, clientId, new RemoveComponentCallback());
+                        idsRemovedSet.add(clientId);
+                    }
+                }
+                clientIdsRemoved.clear();
+                clientIdsRemoved.addAll(idsRemovedSet);
+            }
+            finally
+            {
+                context.getAttributes().remove(FaceletViewDeclarationLanguage.REMOVING_COMPONENTS_BUILD);
+            }
+        }
+        List<String> clientIdsAdded = getClientIdsAdded(view);
+        if (clientIdsAdded != null)
+        {
+            Set<String> idsAddedSet = new HashSet<String>(HashMapUtils.calcCapacity(clientIdsAdded.size()));
+            // perf: clientIds are ArrayList: see method setClientsIdsAdded(String)
+            for (int i = 0, size = clientIdsAdded.size(); i < size; i++)
+            {
+                String clientId = clientIdsAdded.get(i);
+                if (!idsAddedSet.contains(clientId))
+                {
+                    final AttachedFullStateWrapper wrapper = (AttachedFullStateWrapper) states.get(clientId);
+                    if (wrapper != null)
+                    {
+                        final Object[] addedState = (Object[]) wrapper.getWrappedStateObject(); 
+                        if (addedState != null)
+                        {
+                            if (addedState.length == 2)
+                            {
+                                view = (UIViewRoot)
+                                        internalRestoreTreeStructure((TreeStructComponent) addedState[0]);
+                                view.processRestoreState(context, addedState[1]);
+                                break;
+                            }
+                            else
+                            {
+                                final String parentClientId = (String) addedState[0];
+                                view.invokeOnComponent(context, parentClientId, 
+                                    new AddComponentCallback(addedState));
+                            }
+                        }
+                    }
+                    idsAddedSet.add(clientId);
+                }
+            }
+            // Reset this list, because it will be calculated later when the view is being saved
+            // in the right order, preventing duplicates (see COMPONENT_ADDED_AFTER_BUILD_VIEW for details).
+            clientIdsAdded.clear();
+        }
+    }
+
+    public static class RemoveComponentCallback implements ContextCallback
+    {
+        public void invokeContextCallback(FacesContext context,
+                UIComponent target)
+        {
+            if (target.getParent() != null)
+            {
+                if (!target.getParent().getChildren().remove(target))
+                {
+                    String key = null;
+                    if (target.getParent().getFacetCount() > 0)
+                    {
+                        for (Map.Entry<String, UIComponent> entry :
+                                target.getParent().getFacets().entrySet())
+                        {
+                            if (entry.getValue()==target)
+                            {
+                                key = entry.getKey();
+                                break;
+                            }
+                        }
+                    }
+                    if (key != null)
+                    {
+                        target.getParent().getFacets().remove(key);
+                    }
+                }
+            }
+        }
+    }
+
+    public static class AddComponentCallback implements ContextCallback
+    {
+        private final Object[] addedState;
+        
+        public AddComponentCallback(Object[] addedState)
+        {
+            this.addedState = addedState;
+        }
+        
+        public void invokeContextCallback(FacesContext context,
+                UIComponent target)
+        {
+            if (addedState[1] != null)
+            {
+                String facetName = (String) addedState[1];
+                UIComponent child
+                        = internalRestoreTreeStructure((TreeStructComponent)
+                                                       addedState[3]);
+                child.processRestoreState(context, addedState[4]);
+                target.getFacets().put(facetName,child);
+            }
+            else
+            {
+                Integer childIndex = (Integer) addedState[2];
+                UIComponent child
+                        = internalRestoreTreeStructure((TreeStructComponent)
+                                                       addedState[3]);
+                child.processRestoreState(context, addedState[4]);
+                try
+                {
+                    target.getChildren().add(childIndex, child);
+                }
+                catch (IndexOutOfBoundsException e)
+                {
+                    // We can't be sure about where should be this 
+                    // item, so just add it. 
+                    target.getChildren().add(child);
+                }
+            }
+        }
+    }
 
     @Override
     public Object saveView (FacesContext context)
@@ -578,8 +600,12 @@ public class DefaultFaceletsStateManagem
             
             // As required by ResponseStateManager, the return value is an Object array.  First
             // element is the structure object, second is the state map.
-
-            if (states == null)
+            Long uniqueIdCount = (Long) view.getAttributes().get(UNIQUE_ID_COUNTER_KEY);
+            if (uniqueIdCount != null && !uniqueIdCount.equals(1L))
+            {
+                serializedView = new Object[] { null, states, uniqueIdCount };
+            }
+            else if (states == null)
             {
                 serializedView = EMPTY_STATES;
             }
@@ -703,7 +729,7 @@ public class DefaultFaceletsStateManagem
             component.popComponentFromEL(context);
         }
     }
-    
+
     static List<String> getClientIdsAdded(UIViewRoot root)
     {
         return (List<String>) root.getAttributes().get(CLIENTIDS_ADDED);
@@ -1201,7 +1227,7 @@ public class DefaultFaceletsStateManagem
         }
     }
     
-    private TreeStructComponent internalBuildTreeStructureToSave(UIComponent component)
+    private static TreeStructComponent internalBuildTreeStructureToSave(UIComponent component)
     {
         TreeStructComponent structComp = new TreeStructComponent(component.getClass().getName(),
                                                                  component.getId());
@@ -1248,7 +1274,7 @@ public class DefaultFaceletsStateManagem
         return structComp;
     }
     
-    private UIComponent internalRestoreTreeStructure(TreeStructComponent treeStructComp)
+    private static UIComponent internalRestoreTreeStructure(TreeStructComponent treeStructComp)
     {
         String compClass = treeStructComp.getComponentClass();
         String compId = treeStructComp.getComponentId();

Modified: myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java Wed Dec 12 20:45:33 2012
@@ -50,6 +50,8 @@ import javax.faces.view.facelets.Validat
 
 import org.apache.myfaces.util.ExternalSpecifications;
 import org.apache.myfaces.view.facelets.AbstractFaceletContext;
+import org.apache.myfaces.view.facelets.ComponentState;
+import org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy;
 import org.apache.myfaces.view.facelets.FaceletCompositionContext;
 import org.apache.myfaces.view.facelets.tag.MetaRulesetImpl;
 import org.apache.myfaces.view.facelets.tag.jsf.core.AjaxHandler;
@@ -435,6 +437,18 @@ public class ComponentTagHandlerDelegate
                     ComponentSupport.getViewRoot(ctx, c).getAttributes().put("oam.CALL_PRE_DISPOSE_VIEW", Boolean.TRUE);
                     c.subscribeToEvent(PreDisposeViewEvent.class, new ClearBindingValueExpressionListener());
                 }
+                
+                if (c.getChildCount() > 0 || c.getFacetCount() > 0)
+                {
+                    // In this case, this component is used to hold a subtree that is generated
+                    // dynamically. In this case, the best is mark this component to be restored
+                    // fully, because this ensures the state is correctly preserved. Note this
+                    // is only necessary when the component has additional children or facets,
+                    // because those components requires an unique id provided by createUniqueId(),
+                    // and this ensures stability of the generated ids.
+                    c.getAttributes().put(DefaultFaceletsStateManagementStrategy.COMPONENT_ADDED_AFTER_BUILD_VIEW,
+                                          ComponentState.REMOVE_ADD);
+                }
             }
         }
         else

Propchange: myfaces/core/branches/2.2.x/impl/src/main/resources/META-INF/faces-config20.vm
------------------------------------------------------------------------------
  Merged /myfaces/core/trunk/impl/src/main/resources/META-INF/faces-config20.vm:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589
  Merged /myfaces/core/branches/2.1.x-client-window/impl/src/main/resources/META-INF/faces-config20.vm:r1410207-1420939

Propchange: myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheTest.java
------------------------------------------------------------------------------
  Merged /myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheTest.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589
  Merged /myfaces/core/branches/2.1.x-client-window/impl/src/test/java/org/apache/myfaces/application/viewstate/ClientSideStateCacheTest.java:r1410207-1420939

Propchange: myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheTest.java
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/impl/src/test/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheTest.java:r1410207-1420939
  Merged /myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheTest.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Modified: myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesTestCase.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesTestCase.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesTestCase.java Wed Dec 12 20:45:33 2012
@@ -34,13 +34,23 @@ import java.util.logging.Logger;
 import javax.el.ExpressionFactory;
 import javax.faces.FacesException;
 import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
+import javax.faces.application.ProjectStage;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIViewRoot;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 import javax.faces.context.FacesContextFactory;
+import javax.faces.context.Flash;
+import javax.faces.event.ExceptionQueuedEvent;
+import javax.faces.event.ExceptionQueuedEventContext;
 import javax.faces.event.PhaseId;
 import javax.faces.event.PhaseListener;
+import javax.faces.event.PreRenderViewEvent;
 import javax.faces.lifecycle.Lifecycle;
 import javax.faces.lifecycle.LifecycleFactory;
+import javax.faces.view.ViewDeclarationLanguage;
 import javax.faces.webapp.FacesServlet;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
@@ -52,6 +62,7 @@ import org.apache.myfaces.config.Runtime
 import org.apache.myfaces.config.element.FacesConfig;
 import org.apache.myfaces.config.impl.digester.elements.Factory;
 import org.apache.myfaces.lifecycle.LifecycleImpl;
+import org.apache.myfaces.lifecycle.ViewNotFoundException;
 import org.apache.myfaces.mc.test.core.annotation.DeclareFacesConfig;
 import org.apache.myfaces.mc.test.core.annotation.ManagedBeans;
 import org.apache.myfaces.mc.test.core.annotation.PageBean;
@@ -62,6 +73,7 @@ import org.apache.myfaces.test.el.MockEx
 import org.apache.myfaces.test.mock.MockPrintWriter;
 import org.apache.myfaces.test.mock.MockServletConfig;
 import org.apache.myfaces.test.mock.MockServletContext;
+import org.apache.myfaces.util.DebugUtils;
 import org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage;
 import org.apache.myfaces.webapp.AbstractFacesInitializer;
 import org.apache.myfaces.webapp.StartupServletContextListener;
@@ -99,6 +111,13 @@ public abstract class AbstractMyFacesTes
     
     public static final String LAST_PHASE_PROCESSED = "oam.LAST_PHASE_PROCESSED";
     
+    public static final String LAST_RENDER_PHASE_STEP = "oam.LAST_RENDER_PHASE_STEP";
+    
+    public static final int BEFORE_RENDER_STEP = 1;
+    public static final int BUILD_VIEW_CYCLE_STEP = 2;
+    public static final int VIEWHANDLER_RENDER_STEP = 3;
+    public static final int AFTER_RENDER_STEP = 4;
+    
     // ------------------------------------------------------------ Constructors
 
     /**
@@ -446,6 +465,7 @@ public abstract class AbstractMyFacesTes
         processRemainingExecutePhases(facesContext);
         lifecycle.render(facesContext);
         facesContext.getAttributes().put(LAST_PHASE_PROCESSED, PhaseId.RENDER_RESPONSE);
+        facesContext.getAttributes().put(LAST_RENDER_PHASE_STEP, AFTER_RENDER_STEP);
     }
     
     protected void processRemainingExecutePhases(FacesContext facesContext) throws Exception
@@ -516,7 +536,29 @@ public abstract class AbstractMyFacesTes
             }
             if (continueProcess || PhaseId.INVOKE_APPLICATION.equals(lastPhaseId))
             {
-                processRender(facesContext);
+                Integer step = (Integer) facesContext.getAttributes().get(LAST_RENDER_PHASE_STEP);
+                if (step == null)
+                {
+                    processRender(facesContext);
+                }
+                else
+                {
+                    if (BEFORE_RENDER_STEP == step.intValue())
+                    {
+                        executeBuildViewCycle(facesContext);
+                        executeViewHandlerRender(facesContext);
+                        executeAfterRender(facesContext);
+                    }
+                    else if (BUILD_VIEW_CYCLE_STEP == step.intValue())
+                    {
+                        executeViewHandlerRender(facesContext);
+                        executeAfterRender(facesContext);
+                    }
+                    else if (VIEWHANDLER_RENDER_STEP == step.intValue())
+                    {
+                        executeAfterRender(facesContext);
+                    }
+                }
             }
         }
     }
@@ -532,6 +574,291 @@ public abstract class AbstractMyFacesTes
         return false;
     }
     
+    protected void executeBeforeRender(FacesContext facesContext) throws Exception
+    {
+        if (lifecycle instanceof LifecycleImpl)
+        {
+            LifecycleImpl lifecycleImpl = (LifecycleImpl) lifecycle;
+            
+            Object phaseExecutor = null;
+            Field renderExecutorField = lifecycleImpl.getClass().getDeclaredField("renderExecutor");
+            if (!renderExecutorField.isAccessible())
+            {
+                renderExecutorField.setAccessible(true);
+            }
+            phaseExecutor = renderExecutorField.get(lifecycleImpl);
+            
+            if (facesContext.getResponseComplete())
+            {
+                return;
+            }
+            
+            Object phaseManager = facesContext.getAttributes().get(PHASE_MANAGER_INSTANCE);
+            if (phaseManager == null)
+            {
+                Method getPhaseListenersMethod = lifecycleImpl.getClass().getDeclaredMethod("getPhaseListeners");
+                if (!getPhaseListenersMethod.isAccessible())
+                {
+                    getPhaseListenersMethod.setAccessible(true);
+                }
+                
+                Constructor<?> plmc = PHASE_MANAGER_CLASS.getDeclaredConstructor(new Class[]{Lifecycle.class, FacesContext.class, PhaseListener[].class});
+                if (!plmc.isAccessible())
+                {
+                    plmc.setAccessible(true);
+                }
+                phaseManager = plmc.newInstance(lifecycle, facesContext, getPhaseListenersMethod.invoke(lifecycleImpl, null));
+                facesContext.getAttributes().put(PHASE_MANAGER_INSTANCE, phaseManager);
+            }
+            
+            Flash flash = facesContext.getExternalContext().getFlash();
+            
+            try
+            {
+                facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
+                
+                flash.doPrePhaseActions(facesContext);
+                
+                // let the PhaseExecutor do some pre-phase actions
+                
+                //renderExecutor.doPrePhaseActions(facesContext);
+                Method doPrePhaseActionsMethod = phaseExecutor.getClass().getMethod("doPrePhaseActions", FacesContext.class);
+                if(!(doPrePhaseActionsMethod.isAccessible()))
+                {
+                    doPrePhaseActionsMethod.setAccessible(true);
+                }
+                doPrePhaseActionsMethod.invoke(phaseExecutor, facesContext);
+                
+                //phaseListenerMgr.informPhaseListenersBefore(PhaseId.RENDER_RESPONSE);
+                Method informPhaseListenersBeforeMethod = phaseManager.getClass().getDeclaredMethod("informPhaseListenersBefore", PhaseId.class);
+                if(!(informPhaseListenersBeforeMethod.isAccessible()))
+                {
+                    informPhaseListenersBeforeMethod.setAccessible(true);
+                }
+                informPhaseListenersBeforeMethod.invoke(phaseManager, PhaseId.RENDER_RESPONSE);
+                
+                // also possible that one of the listeners completed the response
+                if (facesContext.getResponseComplete())
+                {
+                    return;
+                }
+                
+                //renderExecutor.execute(facesContext);
+            }
+            
+            catch (Throwable e)
+            {
+                // JSF 2.0: publish the executor's exception (if any).
+                ExceptionQueuedEventContext context = new ExceptionQueuedEventContext (facesContext, e, null, PhaseId.RENDER_RESPONSE);
+                facesContext.getApplication().publishEvent (facesContext, ExceptionQueuedEvent.class, context);
+            }
+            
+            finally
+            {
+                /*
+                phaseListenerMgr.informPhaseListenersAfter(renderExecutor.getPhase());
+                flash.doPostPhaseActions(facesContext);
+                
+                // publish a field in the application map to indicate
+                // that the first request has been processed
+                requestProcessed(facesContext);
+                */
+            }
+            
+            facesContext.getExceptionHandler().handle();
+            
+
+            facesContext.getAttributes().remove(PHASE_MANAGER_INSTANCE);
+            
+            facesContext.getAttributes().put(LAST_RENDER_PHASE_STEP, BEFORE_RENDER_STEP);
+        }
+        else
+        {
+            throw new UnsupportedOperationException("Cannot execute phase on custom lifecycle instances");
+        }
+    }
+    
+    public void executeBuildViewCycle(FacesContext facesContext) throws Exception
+    {
+        Application application = facesContext.getApplication();
+        ViewHandler viewHandler = application.getViewHandler();
+        UIViewRoot root;
+        UIViewRoot previousRoot;
+        String viewId;
+        String newViewId;
+        boolean isNotSameRoot;
+        int loops = 0;
+        int maxLoops = 15;
+        
+        if (facesContext.getViewRoot() == null)
+        {
+            throw new ViewNotFoundException("A view is required to execute "+facesContext.getCurrentPhaseId());
+        }
+        
+        try
+        {
+            // do-while, because the view might change in PreRenderViewEvent-listeners
+            do
+            {
+                root = facesContext.getViewRoot();
+                previousRoot = root;
+                viewId = root.getViewId();
+                
+                ViewDeclarationLanguage vdl = viewHandler.getViewDeclarationLanguage(
+                        facesContext, viewId);
+                if (vdl != null)
+                {
+                    vdl.buildView(facesContext, root);
+                }
+                
+                // publish a PreRenderViewEvent: note that the event listeners
+                // of this event can change the view, so we have to perform the algorithm 
+                // until the viewId does not change when publishing this event.
+                application.publishEvent(facesContext, PreRenderViewEvent.class, root);
+                
+                // was the response marked as complete by an event listener?
+                if (facesContext.getResponseComplete())
+                {
+                    return;
+                }
+
+                root = facesContext.getViewRoot();
+                
+                newViewId = root.getViewId();
+                
+                isNotSameRoot = !( (newViewId == null ? newViewId == viewId : newViewId.equals(viewId) ) && 
+                        previousRoot.equals(root) ); 
+                
+                loops++;
+            }
+            while ((newViewId == null && viewId != null) 
+                    || (newViewId != null && (!newViewId.equals(viewId) || isNotSameRoot ) ) && loops < maxLoops);
+            
+            if (loops == maxLoops)
+            {
+                // PreRenderView reach maxLoops - probably a infinitive recursion:
+                boolean production = facesContext.isProjectStage(ProjectStage.Production);
+                /*
+                Level level = production ? Level.FINE : Level.WARNING;
+                if (log.isLoggable(level))
+                {
+                    log.log(level, "Cicle over buildView-PreRenderViewEvent on RENDER_RESPONSE phase "
+                                   + "reaches maximal limit, please check listeners for infinite recursion.");
+                }*/
+            }
+            
+            facesContext.getAttributes().put(LAST_RENDER_PHASE_STEP, BUILD_VIEW_CYCLE_STEP);
+        }
+        catch (IOException e)
+        {
+            throw new FacesException(e.getMessage(), e);
+        }
+    }
+    
+    public void executeViewHandlerRender(FacesContext facesContext)
+    {
+        Application application = facesContext.getApplication();
+        ViewHandler viewHandler = application.getViewHandler();
+
+        try
+        {
+            viewHandler.renderView(facesContext, facesContext.getViewRoot());
+            
+            // log all unhandled FacesMessages, don't swallow them
+            // perf: org.apache.myfaces.context.servlet.FacesContextImpl.getMessageList() creates
+            // new Collections.unmodifiableList with every invocation->  call it only once
+            // and messageList is RandomAccess -> use index based loop
+            List<FacesMessage> messageList = facesContext.getMessageList();
+            if (!messageList.isEmpty())
+            {
+                StringBuilder builder = new StringBuilder();
+                //boolean shouldLog = false;
+                for (int i = 0, size = messageList.size(); i < size; i++)
+                {
+                    FacesMessage message = messageList.get(i);
+                    if (!message.isRendered())
+                    {
+                        builder.append("\n- ");
+                        builder.append(message.getDetail());
+                        
+                        //shouldLog = true;
+                    }
+                }
+                /*
+                if (shouldLog)
+                {
+                    log.log(Level.WARNING, "There are some unhandled FacesMessages, " +
+                            "this means not every FacesMessage had a chance to be rendered.\n" +
+                            "These unhandled FacesMessages are: " + builder.toString());
+                }*/
+            }
+            facesContext.getAttributes().put(LAST_RENDER_PHASE_STEP, VIEWHANDLER_RENDER_STEP);
+        }
+        catch (IOException e)
+        {
+            throw new FacesException(e.getMessage(), e);
+        }
+    }
+    
+    public void executeAfterRender(FacesContext facesContext) throws Exception
+    {
+        if (lifecycle instanceof LifecycleImpl)
+        {
+            LifecycleImpl lifecycleImpl = (LifecycleImpl) lifecycle;
+            
+            Object phaseExecutor = null;
+            Field renderExecutorField = lifecycleImpl.getClass().getDeclaredField("renderExecutor");
+            if (!renderExecutorField.isAccessible())
+            {
+                renderExecutorField.setAccessible(true);
+            }
+            phaseExecutor = renderExecutorField.get(lifecycleImpl);
+            
+            Object phaseManager = facesContext.getAttributes().get(PHASE_MANAGER_INSTANCE);
+            if (phaseManager == null)
+            {
+                Method getPhaseListenersMethod = lifecycleImpl.getClass().getDeclaredMethod("getPhaseListeners");
+                if (!getPhaseListenersMethod.isAccessible())
+                {
+                    getPhaseListenersMethod.setAccessible(true);
+                }
+                
+                Constructor<?> plmc = PHASE_MANAGER_CLASS.getDeclaredConstructor(new Class[]{Lifecycle.class, FacesContext.class, PhaseListener[].class});
+                if (!plmc.isAccessible())
+                {
+                    plmc.setAccessible(true);
+                }
+                phaseManager = plmc.newInstance(lifecycle, facesContext, getPhaseListenersMethod.invoke(lifecycleImpl, null));
+                facesContext.getAttributes().put(PHASE_MANAGER_INSTANCE, phaseManager);
+            }
+            
+            
+            Flash flash = facesContext.getExternalContext().getFlash();
+            
+            //phaseListenerMgr.informPhaseListenersAfter(renderExecutor.getPhase());
+            Method informPhaseListenersAfterMethod = phaseManager.getClass().getDeclaredMethod("informPhaseListenersAfter", PhaseId.class);
+            if(!(informPhaseListenersAfterMethod.isAccessible()))
+            {
+                informPhaseListenersAfterMethod.setAccessible(true);
+            }
+            informPhaseListenersAfterMethod.invoke(phaseManager, PhaseId.RENDER_RESPONSE);
+            
+            flash.doPostPhaseActions(facesContext);
+            
+            facesContext.getExceptionHandler().handle();
+
+            facesContext.getAttributes().remove(PHASE_MANAGER_INSTANCE);
+            
+            facesContext.getAttributes().put(LAST_RENDER_PHASE_STEP, AFTER_RENDER_STEP);
+            //End render response phase
+            facesContext.getAttributes().put(LAST_PHASE_PROCESSED, PhaseId.RENDER_RESPONSE);
+        }
+        else
+        {
+            throw new UnsupportedOperationException("Cannot execute phase on custom lifecycle instances");
+        }
+    }
+    
     /**
      * Execute an specified phase, doing some reflection over LifecycleImpl.
      * 

Modified: myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidMyFacesRequestTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidMyFacesRequestTestCase.java?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidMyFacesRequestTestCase.java (original)
+++ myfaces/core/branches/2.2.x/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidMyFacesRequestTestCase.java Wed Dec 12 20:45:33 2012
@@ -22,12 +22,14 @@ import javax.faces.application.StateMana
 import javax.faces.component.UICommand;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIInput;
+import javax.faces.component.UIPanel;
 import javax.faces.component.html.HtmlDataTable;
 
 import junit.framework.Assert;
 
 import org.apache.myfaces.mc.test.core.AbstractMyFacesRequestTestCase;
 import org.apache.myfaces.shared.config.MyfacesConfig;
+import org.apache.myfaces.view.facelets.pss.acid.managed.ResourceDependencyBean;
 import org.junit.Test;
 
 public class AcidMyFacesRequestTestCase extends AbstractMyFacesRequestTestCase
@@ -418,4 +420,92 @@ public class AcidMyFacesRequestTestCase 
         //Check it is restored
         Assert.assertNotNull(component);
     }
+    
+    /**
+     * Check if a dynamic subtree can be created from a binding property, and if it
+     * will be preserved across request. 
+     * 
+     * The idea is just inject a subtree using some code like this:
+     * <code>&lt;h:panelGroup id="panel" binding="#{componentBindingBean.panel}"&gt;</code>
+     * 
+     * The solution is if a binding returns a component that has children or facets
+     * attached, it is not elegible for PSS algorithm because the additional components
+     * are created outside facelets control, and there is no warrant that the same structure
+     * will be generated across requests, violating PSS base principle (it is possible to
+     * restore to the initial state calling vdl.buildView).
+     * 
+     * This test is here because all state saving modes should support this method.
+     * 
+     * @throws Exception 
+     */
+    @Test
+    public void testComponentBinding() throws Exception
+    {
+        setupRequest("/componentBinding1.xhtml");
+        processLifecycleExecuteAndRender();
+        
+        UIComponent comp = facesContext.getViewRoot().findComponent("panel");
+        Assert.assertNotNull(comp);
+        Assert.assertEquals(1, comp.getChildCount());
+        
+        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+        submit(button);
+        processLifecycleExecuteAndRender();
+        
+        comp = facesContext.getViewRoot().findComponent("panel");
+        
+        Assert.assertEquals("value1", comp.getAttributes().get("attr1"));
+        Assert.assertEquals("value2", comp.getChildren().get(0).getAttributes().get("attr2"));
+        
+        button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+        submit(button);
+        processLifecycleExecuteAndRender();
+
+        comp = facesContext.getViewRoot().findComponent("panel");
+        
+        Assert.assertEquals("value1", comp.getAttributes().get("attr1"));
+        Assert.assertEquals("value2", comp.getChildren().get(0).getAttributes().get("attr2"));
+        
+        tearDownRequest();
+    }
+    
+    @Test
+    public void testResourceDependency() throws Exception
+    {
+        setupRequest("/resourceDependency1.xhtml");
+        processLifecycleExecute();
+
+        executeBeforeRender(facesContext);
+        executeBuildViewCycle(facesContext);
+
+        UIPanel headPanel = (UIPanel) facesContext.getViewRoot().getFacet("head");
+        Assert.assertNotNull(headPanel);
+        Assert.assertEquals(1, headPanel.getChildCount());
+        
+        String nextUniqueId = facesContext.getViewRoot().createUniqueId(facesContext, null);
+        
+        executeViewHandlerRender(facesContext);
+        executeAfterRender(facesContext);
+        
+        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
+        submit(button);
+        
+        processLifecycleExecute();
+        
+        ResourceDependencyBean bean = facesContext.getApplication().evaluateExpressionGet(
+            facesContext, "#{resourceDependencyBean}", ResourceDependencyBean.class);
+        bean.setIncludeContent(true);
+        
+        executeBeforeRender(facesContext);
+        executeBuildViewCycle(facesContext);
+        
+        headPanel = (UIPanel) facesContext.getViewRoot().getFacet("head");
+        Assert.assertNotNull(headPanel);
+        Assert.assertEquals(1, headPanel.getChildCount());
+        Assert.assertNotSame(nextUniqueId, headPanel.getChildren().get(0).getId());
+        
+        executeViewHandlerRender(facesContext);
+        executeAfterRender(facesContext);
+    }
+
 }

Modified: myfaces/core/branches/2.2.x/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/WEB-INF/testcomponent.taglib.xml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.2.x/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/WEB-INF/testcomponent.taglib.xml?rev=1420959&r1=1420958&r2=1420959&view=diff
==============================================================================
--- myfaces/core/branches/2.2.x/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/WEB-INF/testcomponent.taglib.xml (original)
+++ myfaces/core/branches/2.2.x/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/WEB-INF/testcomponent.taglib.xml Wed Dec 12 20:45:33 2012
@@ -64,5 +64,12 @@
 			<component-type>com.myapp.UISelfRenderComponent</component-type>
 		</component>
 	</tag>
+    
+    <tag>
+		<tag-name>rdcomponent</tag-name>
+		<component>
+			<component-type>com.myapp.UIRDComponent</component-type>
+		</component>
+	</tag>
 
 </facelet-taglib>
\ No newline at end of file

Propchange: myfaces/core/branches/2.2.x/impl/src/test/resources/org/apache/myfaces/view/facelets/pss/acid/resources/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: myfaces/core/branches/2.2.x/parent/pom.xml
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/parent/pom.xml:r1410207-1420939
  Merged /myfaces/core/trunk/parent/pom.xml:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/parent/src/
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/parent/src:r1410207-1420939
  Merged /myfaces/core/trunk/parent/src:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/shared/
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/shared:r1410207-1420939
  Merged /myfaces/core/trunk/shared:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/shared-public/pom.xml
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/shared-public/pom.xml:r1410207-1420939
  Merged /myfaces/core/trunk/shared-public/pom.xml:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/shared-public/src/
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/shared-public/src:r1410207-1420939
  Merged /myfaces/core/trunk/shared-public/src:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/AttachedDeltaWrapper.java
------------------------------------------------------------------------------
  Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/AttachedDeltaWrapper.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589
  Merged /myfaces/core/branches/2.1.x-client-window/shared-public/src/main/java/org/apache/myfaces/shared/util/AttachedDeltaWrapper.java:r1410207-1420939

Propchange: myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java:r1410207-1420939
  Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/DebugUtils.java
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/shared-public/src/main/java/org/apache/myfaces/shared/util/DebugUtils.java:r1410207-1420939
  Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/DebugUtils.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/RendererUtils.java
------------------------------------------------------------------------------
  Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/RendererUtils.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589
  Merged /myfaces/core/branches/2.1.x-client-window/shared-public/src/main/java/org/apache/myfaces/shared/util/RendererUtils.java:r1410207-1420939

Propchange: myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/TagUtils.java
------------------------------------------------------------------------------
  Merged /myfaces/core/branches/2.1.x-client-window/shared-public/src/main/java/org/apache/myfaces/shared/util/TagUtils.java:r1410207-1420939
  Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/TagUtils.java:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589

Propchange: myfaces/core/branches/2.2.x/shared-public/src/main/java/org/apache/myfaces/shared/util/renderkit/
------------------------------------------------------------------------------
  Merged /myfaces/core/trunk/shared-public/src/main/java/org/apache/myfaces/shared/util/renderkit:r1410540,1410553,1410652,1412781,1412831,1412932,1417719,1418586,1418589
  Merged /myfaces/core/branches/2.1.x-client-window/shared-public/src/main/java/org/apache/myfaces/shared/util/renderkit:r1410207-1420939



Mime
View raw message