java.lang.Object
jakarta.faces.application.StateManager
jakarta.faces.application.StateManagerWrapper
org.omnifaces.cdi.viewscope.ViewScopeStateManager
- All Implemented Interfaces:
FacesWrapper<StateManager>
Right before the state of the current view is written into an ajax response, puts the pending bean storage of OmniFaces
ViewScoped beans of the
current view in the active view scopes, see ViewScopeStorageInSession. In a non-ajax response, this is done by ViewScopeUnloadScriptRenderer
while it renders the unload script at the end of the body. A view which never reaches the client along with its unload script, such as a view which is
redirected or forwarded away from, or a view which is replaced by a file download, an error page or an exception, can never have its view scoped beans
destroyed by an unload. The beans of such a view are therefore destroyed at the end of the request.
This state manager is already registered by OmniFaces' own faces-config.xml and thus gets auto-initialized when the OmniFaces JAR is bundled in
a web application, so end-users do not need to register this state manager explicitly themselves.
- Since:
- 3.14.28
- Author:
- Bauke Scholtz
- See Also:
-
Field Summary
Fields inherited from class jakarta.faces.application.StateManager
FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME, IS_BUILDING_INITIAL_STATE, IS_SAVING_STATE, PARTIAL_STATE_SAVING_PARAM_NAME, SERIALIZE_SERVER_STATE_PARAM_NAME, STATE_SAVING_METHOD_CLIENT, STATE_SAVING_METHOD_PARAM_NAME, STATE_SAVING_METHOD_SERVER -
Constructor Summary
ConstructorsConstructorDescriptionViewScopeStateManager(StateManager wrapped) Construct a new view scope state manager around the given wrapped state manager. -
Method Summary
Modifier and TypeMethodDescriptiongetViewState(FacesContext context) Activates the pending view scope of the current view before delegating.Methods inherited from class jakarta.faces.application.StateManagerWrapper
getWrapped, isSavingStateInClient, writeState
-
Constructor Details
-
ViewScopeStateManager
Construct a new view scope state manager around the given wrapped state manager.- Parameters:
wrapped- The wrapped state manager.
-
-
Method Details
-
getViewState
Activates the pending view scope of the current view before delegating.- Overrides:
getViewStatein classStateManagerWrapper
-