You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/09/14 19:09:56 UTC

svn commit: r695257 - /myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java

Author: skitching
Date: Sun Sep 14 10:09:56 2008
New Revision: 695257

URL: http://svn.apache.org/viewvc?rev=695257&view=rev
Log:
Fix bug noticed by mario: the previous change to this class caused access-scope NOT to be purged on GET requests.

Modified:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java?rev=695257&r1=695256&r2=695257&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java Sun Sep 14 10:09:56 2008
@@ -137,6 +137,14 @@
     {
         javax.faces.context.FacesContext fc = event.getFacesContext();
         UIViewRoot oldViewRoot = fc.getViewRoot();
+        if ((oldViewRoot != null) && fc.getRenderResponse())
+        {
+            // No view was restored; instead the viewRoot that FacesContext just returned
+            // is a *newly created* view that should be rendered, not a postback to be processed.
+            // In this case, save null as the "old" view to indicate that no view was restored,
+            // which will trigger the access-scope checking after rendering is complete.
+            oldViewRoot = null;
+        }
         fc.getExternalContext().getRequestMap().put(OLD_VIEW_KEY, oldViewRoot);
     }