Class StateManagementStrategy

java.lang.Object
jakarta.faces.view.StateManagementStrategy
Direct Known Subclasses:
FaceletFullStateManagementStrategy, FaceletPartialStateManagementStrategy, JspStateManagementStrategy

public abstract class StateManagementStrategy
extends Object

Encapsulate the saving and restoring of the view to enable the VDL to take over the responsibility for handling this feature. Because ViewDeclarationLanguage.getStateManagementStrategy(jakarta.faces.context.FacesContext, java.lang.String) is required to return null for Jakarta Server Pages views and non-null for views authored in Facelets for Jakarta Server Faces 2, this specification only applies to Facelets for Jakarta Server Faces 2.

Implementations must call UIComponent.visitTree(jakarta.faces.component.visit.VisitContext, jakarta.faces.component.visit.VisitCallback) on the UIViewRoot to perform the saving and restoring of the view in the saveView(jakarta.faces.context.FacesContext) and restoreView(jakarta.faces.context.FacesContext, java.lang.String, java.lang.String) methods, respectively.

Since:
2.0
  • Constructor Summary

    Constructors 
    Constructor Description
    StateManagementStrategy()  
  • Method Summary

    Modifier and Type Method Description
    abstract UIViewRoot restoreView​(FacesContext context, String viewId, String renderKitId)
    Restore the state of the view with information in the request.
    abstract Object saveView​(FacesContext context)
    Return the state of the current view in an Object that implements Serializable and can be passed to java.io.ObjectOutputStream.writeObject() without causing a java.io.NotSerializableException to be thrown. The default implementation must perform the following algorithm or its semantic equivalent, explicitly performing all the steps listed here.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait