Most tutorials propose a default JSF configuration similar to the following web.xml:
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
With this configuration the corresponding *.xhtml files in my webapp are only found by the Faces Servlet if the corresponding URLs ends with the file extension .jsf (e.g. http://localhost/welcome.jsf). Is it possible to configure web.xml so URLs that do not end with .jsf are also processed as JSF pages using the same *.xhtml files?
In other words I would like to have URLs that do not depend on the server side implementation.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…