public class DefaultViewHandlerSupport extends Object implements ViewHandlerSupport
Constructor and Description |
---|
DefaultViewHandlerSupport() |
DefaultViewHandlerSupport(FacesContext facesContext) |
Modifier and Type | Method and Description |
---|---|
String |
calculateActionURL(FacesContext context,
String viewId)
Return a string containing a webapp-relative URL that the user can invoke
to render the specified view.
|
String |
calculateAndCheckViewId(FacesContext context,
String viewId) |
String |
calculateViewId(FacesContext context,
String viewId) |
protected boolean |
checkResourceExists(FacesContext facesContext,
String viewId) |
protected String[] |
getContextSuffix(FacesContext context) |
protected String |
getFaceletsContextSuffix(FacesContext context) |
protected String[] |
getFaceletsViewMappings(FacesContext context) |
protected FacesServletMapping |
getFacesServletMapping(FacesContext context)
Read the web.xml file that is in the classpath and parse its internals to
figure out how the FacesServlet is mapped for the current webapp.
|
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.
|
public DefaultViewHandlerSupport()
public DefaultViewHandlerSupport(FacesContext facesContext)
public String calculateViewId(FacesContext context, String viewId)
calculateViewId
in interface ViewHandlerSupport
public String calculateAndCheckViewId(FacesContext context, String viewId)
calculateAndCheckViewId
in interface ViewHandlerSupport
public String calculateActionURL(FacesContext context, String viewId)
ViewHandlerSupport
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".
calculateActionURL
in interface ViewHandlerSupport
protected FacesServletMapping getFacesServletMapping(FacesContext context)
protected String[] getContextSuffix(FacesContext context)
protected String getFaceletsContextSuffix(FacesContext context)
protected String[] getFaceletsViewMappings(FacesContext context)
protected String handlePrefixMapping(String viewId, String prefix)
For example, both /faces/view.xhtml and /faces/faces/faces/view.xhtml would both return view.xhtml
protected String handleSuffixMapping(FacesContext context, String requestViewId)
For example, an input parameter of "/foo.jsf" may return "/foo.jsp".
protected boolean checkResourceExists(FacesContext facesContext, String viewId)
Copyright © 2020 The Apache Software Foundation. All rights reserved.