Class ViewIdSupport


  • public class ViewIdSupport
    extends Object
    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 Detail

      • ViewIdSupport

        protected ViewIdSupport​(FacesContext facesContext)
    • Method Detail

      • calculateActionURL

        public String calculateActionURL​(FacesContext context,
                                         String viewId)
        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

        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.

        For example, both /faces/view.xhtml and /faces/faces/faces/view.xhtml would both return view.xhtml

      • handleSuffixMapping

        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.

        For example, an input parameter of "/foo.jsf" may return "/foo.jsp".

      • isViewExistent

        public boolean isViewExistent​(FacesContext facesContext,
                                      String viewId)
        Check if a view exists
        Parameters:
        facesContext -
        viewId -
        Returns:
      • isViewProtected

        public boolean isViewProtected​(FacesContext context,
                                       String viewId)