Diff of /myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
Parent Directory
| Revision Log
| Patch
--- myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java 2005/11/25 00:03:17 348837
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java 2005/11/25 00:28:55 348838
@@ -55,7 +55,9 @@ import org.apache.myfaces.renderkit.Myfa
import org.apache.myfaces.renderkit.RendererUtils;
/**
- * Default StateManager implementation.
+ * Default StateManager implementation for use when views are defined
+ * via tags in JSP pages.
+ *
* @author Thomas Spiegl (latest modification by $Author$)
* @author Manfred Geiler
* @version $Revision$ $Date$
@@ -106,6 +108,12 @@ public class JspStateManagerImpl
return serializedComponentStates;
}
+ /**
+ * Return an object which contains info about the UIComponent type
+ * of each node in the view tree. This allows an identical UIComponent
+ * tree to be recreated later, though all the components will have
+ * just default values for their members.
+ */
protected Object getTreeStructureToSave(FacesContext facesContext)
{
UIViewRoot viewRoot = facesContext.getViewRoot();
@@ -117,10 +125,20 @@ public class JspStateManagerImpl
return tsm.buildTreeStructureToSave(viewRoot);
}
+ /**
+ * Given a tree of UIComponent objects created the default constructor
+ * for each node, retrieve saved state info (from either the client or
+ * the server) and walk the tree restoring the members of each node
+ * from the saved state information.
+ */
protected void restoreComponentState(FacesContext facesContext,
UIViewRoot uiViewRoot,
String renderKitId)
{
+ //===========================================
+ // first, locate the saved state information
+ //===========================================
+
Object serializedComponentStates;
if (isSavingStateInClient(facesContext))
{
@@ -160,9 +178,13 @@ public class JspStateManagerImpl
uiViewRoot.setRenderKitId(renderKitId);
}
+ // now ask the view root component to restore its state
uiViewRoot.processRestoreState(facesContext, serializedComponentStates);
}
+ /**
+ * See getTreeStructureToSave.
+ */
protected UIViewRoot restoreTreeStructure(FacesContext facesContext,
String viewId,
String renderKitId)