Class ViewIdSupport

java.lang.Object
org.apache.myfaces.application.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 Details

    • ViewIdSupport

      protected ViewIdSupport(FacesContext facesContext)
  • Method Details

    • getInstance

      public static ViewIdSupport getInstance(FacesContext facesContext)
    • deriveLogicalViewId

      public String deriveLogicalViewId(FacesContext context, String rawViewId)
    • deriveViewId

      public String deriveViewId(FacesContext context, String viewId)
    • deriveViewId

      protected String deriveViewId(FacesContext context, String rawViewId, boolean checkViewExists)
    • 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:
    • calculateViewId

      public String calculateViewId(FacesContext facesContext)

      Calculates the view id from the given faces context by the following algorithm

    • isViewProtected

      public boolean isViewProtected(FacesContext context, String viewId)