Class JspViewHandlingStrategy
public class JspViewHandlingStrategy extends ViewHandlingStrategy
ViewHandlingStrategy handles JSP-based views.-
Field Summary
Fields inherited from class com.sun.faces.application.view.ViewHandlingStrategy
associate, webConfigFields inherited from class jakarta.faces.view.ViewDeclarationLanguage
FACELETS_VIEW_DECLARATION_LANGUAGE_ID, JSP_VIEW_DECLARATION_LANGUAGE_ID -
Constructor Summary
Constructors Constructor Description JspViewHandlingStrategy() -
Method Summary
Modifier and Type Method Description voidbuildView(FacesContext context, UIViewRoot view)Take any actions specific to this VDL implementation to cause the argumentUIViewRootwhich must have been created via a call toViewDeclarationLanguage.createView(jakarta.faces.context.FacesContext, java.lang.String), to be populated with children.BeanInfogetComponentMetadata(FacesContext context, Resource componentResource)Not supported in JSP-based views.StringgetId()Returns a non-null String that can be used to identify this view declaration language.ResourcegetScriptComponentResource(FacesContext context, Resource componentResource)Not supported in JSP-based views.StateManagementStrategygetStateManagementStrategy(FacesContext context, String viewId)For implementations that want to control the implementation of state saving and restoring, theStateManagementStrategyallows them to do so.ViewMetadatagetViewMetadata(FacesContext context, String viewId)Not supported in JSP-based views.Stream<String>getViews(FacesContext context, String path, int maxDepth, ViewVisitOption... options)Not supported in JSP-based views.Stream<String>getViews(FacesContext context, String path, ViewVisitOption... options)Not supported in JSP-based views.booleanhandlesViewId(String viewId)ThisViewHandlingStrategyshould be the last one queried and as such we returntrue.voidrenderView(FacesContext context, UIViewRoot view)Render a view rooted at argumentview.Methods inherited from class com.sun.faces.application.view.ViewHandlingStrategy
createView, restoreViewMethods inherited from class jakarta.faces.view.ViewDeclarationLanguage
calculateResourceLibraryContracts, createComponent, retargetAttachedObjects, retargetMethodExpressions, viewExists
-
Constructor Details
-
JspViewHandlingStrategy
public JspViewHandlingStrategy()
-
-
Method Details
-
getViewMetadata
Not supported in JSP-based views.
- Specified by:
getViewMetadatain classViewDeclarationLanguage- Parameters:
context- TheFacesContextfor this request.viewId- the view id from which to extract the metadata- Returns:
- the view metadata
- See Also:
ViewDeclarationLanguage.getViewMetadata(jakarta.faces.context.FacesContext, String)
-
buildView
Description copied from class:ViewDeclarationLanguageTake any actions specific to this VDL implementation to cause the argument
UIViewRootwhich must have been created via a call toViewDeclarationLanguage.createView(jakarta.faces.context.FacesContext, java.lang.String), to be populated with children.The Facelets implementation must insure that markup comprising the view must be executed, with the
UIComponentinstances in the view being encountered in the same depth-first order as in other lifecycle methods defined onUIComponent, and added to the view (but not rendered) during the traversal. The runtime must guarantee that the view must be fully populated before any of the following happen.-
The
PhaseListener.afterPhase(jakarta.faces.event.PhaseEvent)method of anyPhaseListeners attached to the application is called -
The
UIViewRootphase listener installed viaUIViewRoot.setAfterPhaseListener(jakarta.el.MethodExpression)orUIViewRoot.addPhaseListener(jakarta.faces.event.PhaseListener)are called.
If the
rootis already populated with children, the view must still be re-built, but care must be taken to ensure that the existing components are correctly paired up with their VDL counterparts in the VDL page. Also, any system events that would normally be generated during the adding or removing of components from the view must be temporarily disabled during the creation of the view and then re-enabled when the view has been built.- Specified by:
buildViewin classViewDeclarationLanguage- Parameters:
context-view-- Throws:
IOException- See Also:
ViewDeclarationLanguage.buildView(jakarta.faces.context.FacesContext, jakarta.faces.component.UIViewRoot)
-
-
renderView
Description copied from class:ViewDeclarationLanguageRender a view rooted at argument
view. See section JSF.7.7.2 for the specification of the default implementation.- Specified by:
renderViewin classViewDeclarationLanguage- Parameters:
context- theFacesContextfor this request.view- theUIViewRootfrom an early call toViewDeclarationLanguage.createView(jakarta.faces.context.FacesContext, java.lang.String)orViewDeclarationLanguage.restoreView(jakarta.faces.context.FacesContext, java.lang.String).- Throws:
IOException- if the view cannot be rendered for any reason- See Also:
ViewDeclarationLanguage.renderView(jakarta.faces.context.FacesContext, jakarta.faces.component.UIViewRoot)
-
getStateManagementStrategy
Description copied from class:ViewDeclarationLanguageFor implementations that want to control the implementation of state saving and restoring, the
StateManagementStrategyallows them to do so. Returningnullindicates that the implementation wishes the runtime to handle the state saving and restoring. Implementations that provide the VDL for Facelets for Jakarta Server Faces 2.0 and later must return non-nullfrom this method.- Specified by:
getStateManagementStrategyin classViewDeclarationLanguage- Parameters:
context- theFacesContextfor the current request.viewId- the view id.- Returns:
- the strategy as specified above
-
getComponentMetadata
Not supported in JSP-based views.
- Specified by:
getComponentMetadatain classViewDeclarationLanguage- Parameters:
context- TheFacesContextfor this request.componentResource- TheResourcethat represents the component.- Returns:
- the component metadata
- See Also:
ViewDeclarationLanguage.getComponentMetadata(jakarta.faces.context.FacesContext, jakarta.faces.application.Resource)
-
getScriptComponentResource
Not supported in JSP-based views.
- Specified by:
getScriptComponentResourcein classViewDeclarationLanguage- Parameters:
context- TheFacesContextfor this request.componentResource- TheResourcethat represents the component.- Returns:
- the
Resourcecorresponding to the argumentcomponentResource - See Also:
ViewDeclarationLanguage.getScriptComponentResource(jakarta.faces.context.FacesContext, jakarta.faces.application.Resource)
-
getViews
Not supported in JSP-based views.
- Overrides:
getViewsin classViewDeclarationLanguage- Parameters:
context- TheFacesContextfor this request.path- The initial path from which to start looking for viewsoptions- The options to influence the traversal. SeeViewVisitOptionfor details on those.- Returns:
- the
Streamof view ids - See Also:
ViewDeclarationLanguage.getViews(FacesContext, String, ViewVisitOption...)
-
getViews
public Stream<String> getViews(FacesContext context, String path, int maxDepth, ViewVisitOption... options)Not supported in JSP-based views.
- Overrides:
getViewsin classViewDeclarationLanguage- Parameters:
context- TheFacesContextfor this request.path- The initial path from which to start looking for viewsmaxDepth- The absolute maximum depth of nested directories to visit counted from the root (/).options- The options to influence the traversal. SeeViewVisitOptionfor details on those.- Returns:
- the
Streamof view ids - See Also:
ViewDeclarationLanguage.getViews(FacesContext, String, int, ViewVisitOption...)
-
handlesViewId
ThisViewHandlingStrategyshould be the last one queried and as such we returntrue.- Specified by:
handlesViewIdin classViewHandlingStrategy- Parameters:
viewId- the view ID- Returns:
trueif thisViewHandlingStrategyhandles the the view type represented byviewId- See Also:
ViewHandlingStrategy.handlesViewId(String)
-
getId
Description copied from class:ViewDeclarationLanguageReturns a non-null String that can be used to identify this view declaration language.
The default implementation returns the fully qualified class name of the view declaration language implementation. Subclasses may override to provide a more meaningful id.
- Overrides:
getIdin classViewDeclarationLanguage- Returns:
- the id of this view declaration language
-