javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-1099

Resolve views by convention from dedicated faces-views directory

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Facelets/VDL
    • Labels:
      None

      Description

      In JSF 2.1 the FacesServlet is by default mapped to the following URL patterns:

      • /faces/*
      • *.jsf
      • *.faces

      The Facelets VDL will by default try to resolve a corresponding view in the root of the web application; a file with the same path and name as the wildcard in the URL pattern, but with the .xhtml suffix.

      In addition to this mechanism, I would like to propose introducing a dedicated directory where (Facelets) views are resolved. By convention, the existence of this directory in a web application will cause the FacesServlet to be mapped, and will cause it to be mapped to those views that are present in that directory (with subdirectories mapped to paths).

      Just like implicit navigation supports letting the user specify destination views with or without suffix, so could this automatic mapping support URL patterns with or without a suffix, thereby introducing a simple and lightweight pretty URL facility to the platform. Simultaneously, users putting their view files in this directory are automatically protected from the source-code expose vulnerability that exists now when using Facelets (see JAVASERVERFACES_SPEC_PUBLIC-1015).

      Example:

      WebContent
          WEB-INF
              faces-views
                  foo.xhtml
                  promotion
                       register.xhtml
      

      Assuming the web app containing this is deployed with / as its context root:

      Valid request URLs:

      • localhost:8080/foo
      • localhost:8080/foo.xhtml
      • localhost:8080/promotion/register
      • etc

      Note that there is no web.xml used in this example, and that one should not be necessary.

        Issue Links

          Activity

          Hide
          Ed Burns added a comment -

          Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

          Show
          Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
          Hide
          Manfred Riem added a comment -

          Setting priority to Major

          Show
          Manfred Riem added a comment - Setting priority to Major
          Hide
          Ed Burns added a comment -

          Agreed on IRC ##jsf that this is covered better under JAVASERVERFACES_SPEC_PUBLIC-1359.

          Show
          Ed Burns added a comment - Agreed on IRC ##jsf that this is covered better under JAVASERVERFACES_SPEC_PUBLIC-1359 .

            People

            • Assignee:
              Unassigned
              Reporter:
              arjan tijms
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: