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.
you can create url mapping like this create faces-config.xml file in WEB-INF folder
in web.xml you have to do 2 entries
You can use Filter to hide this extension and make your URL SEO friendly,One of such implementation of Filter is Pretty Filter.
For example: If you need
http://host:port/yourapp/login
to resolve with yourlogin.xhtml
then in pretty filter configure following wayHave a look at two min video tutorial