myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1125062 - /myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/application/StateManager.java
Date Thu, 19 May 2011 19:13:56 GMT
Author: lu4242
Date: Thu May 19 19:13:56 2011
New Revision: 1125062

URL: http://svn.apache.org/viewvc?rev=1125062&view=rev
Log:
MYFACES-3152 javax.faces.application.StateManager default implementation for writeState and
saveSerializedView needs to be implemented

Modified:
    myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/application/StateManager.java

Modified: myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/application/StateManager.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/application/StateManager.java?rev=1125062&r1=1125061&r2=1125062&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/application/StateManager.java
(original)
+++ myfaces/core/branches/2.0.x/api/src/main/java/javax/faces/application/StateManager.java
Thu May 19 19:13:56 2011
@@ -98,6 +98,16 @@ public abstract class StateManager
      */
     public StateManager.SerializedView saveSerializedView(FacesContext context)
     {
+        Object savedView = saveView(context);
+        if (savedView != null && savedView instanceof Object[])
+        {
+            Object[] structureAndState = (Object[]) savedView;
+            if (structureAndState.length == 2)
+            {
+                return new StateManager.SerializedView(structureAndState[0], structureAndState[1]);
+            }
+        }
+        
         return null;
     }
 
@@ -171,7 +181,10 @@ public abstract class StateManager
     public void writeState(FacesContext context, StateManager.SerializedView state)
         throws IOException
     {
-        // default impl does nothing as per JSF 1.2 javadoc
+        if (state != null)
+        {
+            writeState(context, new Object[]{state.getStructure(), state.getState()});
+        }
     }
 
     /**



Mime
View raw message