public class JspViewHandlingStrategy extends ViewHandlingStrategy
ViewHandlingStrategy
handles JSP-based views.associate, webConfig
FACELETS_VIEW_DECLARATION_LANGUAGE_ID, JSP_VIEW_DECLARATION_LANGUAGE_ID
Constructor and Description |
---|
JspViewHandlingStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
buildView(FacesContext context,
UIViewRoot view)
Take any actions specific to
this VDL implementation to cause the argument
|
BeanInfo |
getComponentMetadata(FacesContext context,
Resource componentResource)
Not supported in JSP-based views.
|
String |
getId()
Returns a non-null String that can be used to identify this view declaration language. |
Resource |
getScriptComponentResource(FacesContext context,
Resource componentResource)
Not supported in JSP-based views.
|
StateManagementStrategy |
getStateManagementStrategy(FacesContext context,
String viewId)
For implementations that want to
control the implementation of state saving and restoring, the
|
ViewMetadata |
getViewMetadata(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.
|
boolean |
handlesViewId(String viewId)
This
ViewHandlingStrategy should be the last one queried
and as such we return true . |
void |
renderView(FacesContext context,
UIViewRoot view)
Render a view rooted at
argument |
createView, restoreView
calculateResourceLibraryContracts, createComponent, retargetAttachedObjects, retargetMethodExpressions, viewExists
public ViewMetadata getViewMetadata(FacesContext context, String viewId)
Not supported in JSP-based views.
getViewMetadata
in class ViewDeclarationLanguage
context
- The FacesContext
for this request.viewId
- the view id from which to extract the metadataViewDeclarationLanguage.getViewMetadata(javax.faces.context.FacesContext, String)
public void buildView(FacesContext context, UIViewRoot view) throws IOException
ViewDeclarationLanguage
Take any actions specific to
this VDL implementation to cause the argument
UIViewRoot
which must have been created via a call
to ViewDeclarationLanguage.createView(javax.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 UIComponent
instances in the view being
encountered in the same depth-first order as in other lifecycle
methods defined on UIComponent
, 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(javax.faces.event.PhaseEvent)
method of any PhaseListener
s attached to the
application is called
The UIViewRoot
phase
listener installed via UIViewRoot.setAfterPhaseListener(javax.el.MethodExpression)
or UIViewRoot.addPhaseListener(javax.faces.event.PhaseListener)
are called.
If the root
is
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.
buildView
in class ViewDeclarationLanguage
context
- view
- IOException
ViewDeclarationLanguage.buildView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)
public void renderView(FacesContext context, UIViewRoot view) throws IOException
ViewDeclarationLanguage
Render a view rooted at
argumentview
. See section JSF.7.7.2 for the
specification of the default implementation.
renderView
in class ViewDeclarationLanguage
context
- the FacesContext
for this request.view
- the UIViewRoot
from an early call to
ViewDeclarationLanguage.createView(javax.faces.context.FacesContext, java.lang.String)
or ViewDeclarationLanguage.restoreView(javax.faces.context.FacesContext, java.lang.String)
.IOException
- if the view cannot be rendered for any reasonViewDeclarationLanguage.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)
public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId)
ViewDeclarationLanguage
For implementations that want to
control the implementation of state saving and restoring, the
StateManagementStrategy
allows them to do so. Returning
null
indicates 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-null
from this method.
getStateManagementStrategy
in class ViewDeclarationLanguage
context
- the FacesContext
for the current request.viewId
- the view id.public BeanInfo getComponentMetadata(FacesContext context, Resource componentResource)
Not supported in JSP-based views.
getComponentMetadata
in class ViewDeclarationLanguage
context
- The FacesContext
for this request.componentResource
- The Resource
that represents the component.ViewDeclarationLanguage.getComponentMetadata(javax.faces.context.FacesContext, javax.faces.application.Resource)
public Resource getScriptComponentResource(FacesContext context, Resource componentResource)
Not supported in JSP-based views.
getScriptComponentResource
in class ViewDeclarationLanguage
context
- The FacesContext
for this request.componentResource
- The Resource
that represents the component.Resource
corresponding to the argument componentResource
ViewDeclarationLanguage.getScriptComponentResource(javax.faces.context.FacesContext, javax.faces.application.Resource)
public Stream<String> getViews(FacesContext context, String path, ViewVisitOption... options)
Not supported in JSP-based views.
getViews
in class ViewDeclarationLanguage
context
- The FacesContext
for this request.path
- The initial path from which to start looking for viewsoptions
- The options to influence the traversal. See ViewVisitOption
for details on those.Stream
of view idsViewDeclarationLanguage.getViews(FacesContext, String, ViewVisitOption...)
public Stream<String> getViews(FacesContext context, String path, int maxDepth, ViewVisitOption... options)
Not supported in JSP-based views.
getViews
in class ViewDeclarationLanguage
context
- The FacesContext
for 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. See ViewVisitOption
for details on those.Stream
of view idsViewDeclarationLanguage.getViews(FacesContext, String, int, ViewVisitOption...)
public boolean handlesViewId(String viewId)
ViewHandlingStrategy
should be the last one queried
and as such we return true
.handlesViewId
in class ViewHandlingStrategy
viewId
- the view IDtrue
if this ViewHandlingStrategy
handles the the view type represented by viewId
ViewHandlingStrategy.handlesViewId(String)
public String getId()
ViewDeclarationLanguage
Returns 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.
getId
in class ViewDeclarationLanguage
Comments to: faces-dev@eclipse.org.
Copyright © 2019 Eclipse Foundation. All rights reserved.
Use is subject to license terms.