Type: New Feature
Resolution: Won't Fix
Affects Version/s: None
Fix Version/s: None
In JSF 2.1 the FacesServlet is by default mapped to the following URL patterns:
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
Assuming the web app containing this is deployed with / as its context root:
Valid request URLs:
Note that there is no web.xml used in this example, and that one should not be necessary.