Package org.apache.myfaces.application
Class ViewIdSupport
java.lang.Object
org.apache.myfaces.application.ViewIdSupport
A ViewHandlerSupport implementation for use with standard Java Servlet engines,
ie an engine that supports jakarta.servlet, and uses a standard web.xml file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateActionURL
(FacesContext context, String viewId) Return a string containing a webapp-relative URL that the user can invoke to render the specified view.calculateViewId
(FacesContext facesContext) Calculates the view id from the given faces context by the following algorithmderiveLogicalViewId
(FacesContext context, String rawViewId) deriveViewId
(FacesContext context, String viewId) protected String
deriveViewId
(FacesContext context, String rawViewId, boolean checkViewExists) static ViewIdSupport
getInstance
(FacesContext facesContext) protected String
handlePrefixMapping
(String viewId, String prefix) Return the normalized viewId according to the algorithm specified in 7.5.2 by stripping off any number of occurrences of the prefix mapping from the viewId.protected String
handleSuffixMapping
(FacesContext context, String requestViewId) Return the viewId with any non-standard suffix stripped off and replaced with the default suffix configured for the specified context.boolean
isViewExistent
(FacesContext facesContext, String viewId) Check if a view existsboolean
isViewProtected
(FacesContext context, String viewId)
-
Constructor Details
-
ViewIdSupport
-
-
Method Details
-
getInstance
-
deriveLogicalViewId
-
deriveViewId
-
deriveViewId
-
calculateActionURL
Return a string containing a webapp-relative URL that the user can invoke to render the specified view.URLs and ViewIds are not quite the same; for example a url of "/foo.jsf" or "/faces/foo.jsp" may be needed to access the view "/foo.jsp".
-
handlePrefixMapping
Return the normalized viewId according to the algorithm specified in 7.5.2 by stripping off any number of occurrences of the prefix mapping from the viewId.For example, both /faces/view.xhtml and /faces/faces/faces/view.xhtml would both return view.xhtml
-
handleSuffixMapping
Return the viewId with any non-standard suffix stripped off and replaced with the default suffix configured for the specified context.For example, an input parameter of "/foo.jsf" may return "/foo.jsp".
-
isViewExistent
Check if a view exists- Parameters:
facesContext
-viewId
-- Returns:
-
calculateViewId
Calculates the view id from the given faces context by the following algorithm
- lookup the viewid from the request attribute "jakarta.servlet.include.path_info"
- if null lookup the value for viewid by
ExternalContext.getRequestPathInfo()
- if null lookup the value for viewid from the request attribute "jakarta.servlet.include.servlet_path"
- if null lookup the value for viewid by
ExternalContext.getRequestServletPath()
- if null throw a
FacesException
-
isViewProtected
-