StateManager directs the process of saving and restoring the view
between requests. An implementation of this class must be
thread-safe. The StateManager instance for an application is retrieved from the
Application instance, and thus cannot know any details of the markup language created by
the RenderKit being used to render a view.
The StateManager utilizes a helper
object (ResponseStateManager), that is provided by the RenderKit implementation
and is therefore aware of the markup language details.
| Modifier and Type | Class and Description |
|---|---|
| public class | StateManager.SerializedView
Deprecated
This class was not marked Serializable in the 1.0 version of the
spec.
Convenience struct for encapsulating tree structure and component state. |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME
The runtime must interpret the value of this parameter as a comma separated list of view IDs, each of which must have their state saved using the state saving mechanism specified in JSF 1.2. |
| public static final String | IS_BUILDING_INITIAL_STATE
Marker within the |
| private static final String | |
| public static final String | IS_SAVING_STATE
Marker within the |
| public static final String | PARTIAL_STATE_SAVING_PARAM_NAME
The |
| private Boolean | |
| public static final String | SERIALIZE_SERVER_STATE_PARAM_NAME
If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, and the javax.faces.STATE_SAVING_METHOD is set to "server" (as indicated below), the server state must be guaranteed to be Serializable such that the aggregate state implements java.io.Serializable. |
| public static final String | STATE_SAVING_METHOD_CLIENT
Constant value for the initialization parameter named by the
|
| public static final String | STATE_SAVING_METHOD_PARAM_NAME
The |
| public static final String | STATE_SAVING_METHOD_SERVER
Constant value for the initialization parameter named by the
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Object | Returns: the component state, or null.FacesContext for the current request
Deprecated
the distinction between tree structure and component state is now an
implementation detail. The default implementation returns
null.
Convenience method, which must be called by |
| protected Object | Returns: the tree structure, or null.FacesContext for the current request
Deprecated
the distinction between tree structure and component state is now an
implementation detail. The default implementation returns
null.
Convenience method, which must be called by |
| public String | Returns: the view state.FacesContext for the current request
Convenience method to return the view state as a |
| public boolean | Returns: true if and only if the value of the ServletContext init
parameter named by the value of the constant STATE_SAVING_METHOD_PARAM_NAME
is equal (ignoring case) to the value of
the constant STATE_SAVING_METHOD_CLIENT. false otherwise.the Faces context. context)Method to determine if the state is saved on the client. |
| protected void | restoreComponentState(FacesContext
FacesContext for the current requestUIViewRoot returned by a previous call to
restoreTreeStructure()the renderKitId used to render this response. Must not be
renderKitId)null.
Deprecated
the distinction between tree structure and component state is now an
implementation detail. The default implementation does nothing.
Convenience method, which must be called by |
| protected UIViewRoot | Returns: the view root, ornull.FacesContext for the current requestView identifier of the view to be restored viewId, String the renderKitId used to render this response. Must not be
renderKitId)null.
Deprecated
the distinction between tree structure and component state is now an
implementation detail. The default implementation returns
null.
Convenience method, which must be called by |
| public abstract UIViewRoot | Returns: the view root, ornull.FacesContext for the current requestView identifier of the view to be restored viewId, String the renderKitId used to render this response. Must not be
renderKitId)null.
Deprecated
The functionality of this method is now handled by
|
| public StateManager. | Returns: the serialized view, or null.FacesContext for the current request
Deprecated
this has been replaced by
saveView.
Return the tree structure and component state information for the view contained in the
specified |
| public Object | Returns: the saved view.FacesContext for the current request
Deprecated
The functionality of this method is now handled by
|
| public void | writeState(FacesContext
FacesContext for the current requestthe Serializable state to be written, as returned by state)saveSerializedView
Save the state represented in the specified state |
| public void | writeState(FacesContext
FacesContext for the current requestthe serialized state to be written state
Deprecated
This method has been replaced by
writeState(javax.faces.context.FacesContext, java.lang.Object).
Save the state represented in the specified |
| FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME | back to summary |
|---|---|
| public static final String FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME The runtime must interpret the value of this parameter as a comma separated list of view IDs, each of which must have their state saved using the state saving mechanism specified in JSF 1.2. | |
| IS_BUILDING_INITIAL_STATE | back to summary |
|---|---|
| public static final String IS_BUILDING_INITIAL_STATE
Marker within the
| |
| IS_CALLED_FROM_API_CLASS | back to summary |
|---|---|
| private static final String IS_CALLED_FROM_API_CLASS | |
| IS_SAVING_STATE | back to summary |
|---|---|
| public static final String IS_SAVING_STATE
Marker within the | |
| PARTIAL_STATE_SAVING_PARAM_NAME | back to summary |
|---|---|
| public static final String PARTIAL_STATE_SAVING_PARAM_NAME
The If undefined, the runtime must determine the version level of the application.
If this parameter is defined, and the application is versioned at 1.2 and under, the runtime
must not use the partial state saving mechanism. Otherwise, If this param is defined, and
calling
| |
| savingStateInClient | back to summary |
|---|---|
| private Boolean savingStateInClient | |
| SERIALIZE_SERVER_STATE_PARAM_NAME | back to summary |
|---|---|
| public static final String SERIALIZE_SERVER_STATE_PARAM_NAME If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, and the javax.faces.STATE_SAVING_METHOD is set to "server" (as indicated below), the server state must be guaranteed to be Serializable such that the aggregate state implements java.io.Serializable. The intent of this parameter is to ensure that the act of writing out the state to an ObjectOutputStream would not throw a NotSerializableException, but the runtime is not required verify this before saving the state.
| |
| STATE_SAVING_METHOD_CLIENT | back to summary |
|---|---|
| public static final String STATE_SAVING_METHOD_CLIENT
Constant value for the initialization parameter named by the
| |
| STATE_SAVING_METHOD_PARAM_NAME | back to summary |
|---|---|
| public static final String STATE_SAVING_METHOD_PARAM_NAME
The
If this parameter is not specified, the default value is the value of the constant
| |
| STATE_SAVING_METHOD_SERVER | back to summary |
|---|---|
| public static final String STATE_SAVING_METHOD_SERVER
Constant value for the initialization parameter named by the
| |
| StateManager | back to summary |
|---|---|
| public StateManager() | |
| getComponentStateToSave | back to summary |
|---|---|
| protected Object getComponentStateToSave(FacesContext context)
Deprecated the distinction between tree structure and component state is now an
implementation detail. The default implementation returns
Convenience method, which must be called by
Components may opt-out of being included in the component state by setting their
| |
| getTreeStructureToSave | back to summary |
|---|---|
| protected Object getTreeStructureToSave(FacesContext context)
Deprecated the distinction between tree structure and component state is now an
implementation detail. The default implementation returns
Convenience method, which must be called by
Components may opt-out of being included in the tree structure by setting their
| |
| getViewState | back to summary |
|---|---|
| public String getViewState(FacesContext context)
Convenience method to return the view state as a
| |
| isSavingStateInClient | back to summary |
|---|---|
| public boolean isSavingStateInClient(FacesContext context) Method to determine if the state is saved on the client.
| |
| restoreComponentState | back to summary |
|---|---|
| protected void restoreComponentState(FacesContext context, UIViewRoot viewRoot, String renderKitId)
Deprecated the distinction between tree structure and component state is now an implementation detail. The default implementation does nothing.
Convenience method, which must be called by
| |
| restoreTreeStructure | back to summary |
|---|---|
| protected UIViewRoot restoreTreeStructure(FacesContext context, String viewId, String renderKitId)
Deprecated the distinction between tree structure and component state is now an
implementation detail. The default implementation returns
Convenience method, which must be called by
| |
| restoreView | back to summary |
|---|---|
| public abstract UIViewRoot restoreView(FacesContext context, String viewId, String renderKitId)
Deprecated
The functionality of this method is now handled by
This method must consult the context initialization parameter named by the symbolic constant
If the init parameter indicates that client side state saving should be used, this method
must call the
| |
| saveSerializedView | back to summary |
|---|---|
| public StateManager. Deprecated this has been replaced by
Return the tree structure and component state information for the view contained in the
specified
Components may opt out of being included in the serialized view by setting their
This method must also enforce the rule that, for components with non-null
| |
| saveView | back to summary |
|---|---|
| public Object saveView(FacesContext context)
Deprecated
The functionality of this method is now handled by
Components may opt out of being included in the serialized view by setting their
This method must also enforce the rule that, for components with non-null
For backwards compatability with existing
| |
| writeState | back to summary |
|---|---|
| public void writeState(FacesContext context, Object state) throws IOException
Save the state represented in the specified state
This method will typically simply delegate the actual writing to the
For backwards compatability with existing
| |
| writeState | back to summary |
|---|---|
| public void writeState(FacesContext context, StateManager. Deprecated This method has been replaced by
Save the state represented in the specified
This method must consult the context initialization parameter named by the symbolic constant
If the init parameter indicates that client side state saving should be used, this method
must delegate the actual writing to the
| |
Deprecated
This class was not marked Serializable in the 1.0 version of the
spec. It was also not a static inner class, so it can't be made to be
Serializable. Therefore, it is being deprecated in version 1.2 of
the spec. The replacement is to use an implementation dependent
Object.
Convenience struct for encapsulating tree structure and component state. This is necessary to allow the API to be flexible enough to work in JSP and non-JSP environments.
| Access | Constructor and Description |
|---|---|
| public |
| state | back to summary |
|---|---|
| private Object state | |
| structure | back to summary |
|---|---|
| private Object structure | |
| SerializedView | back to summary |
|---|---|
| public SerializedView(Object newStructure, Object newState) | |
| getState | back to summary |
|---|---|
| public Object getState() | |
| getStructure | back to summary |
|---|---|
| public Object getStructure() | |