In a JSF application, we have the directory hierarchy:
webapp
xhtml
login.xhtml
main.xhtml
search.xhtml
css
main.css
extra.css
js
jquery.js
etc. The servlet mapping is:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
This works fine, but the URLs of our web app look like this:
http://localhost/myapp/xhtml/login.xhtml
http://localhost/myapp/xhtml/search.xhtml
We would like to have simpler URLs by dropping the /xhtml
part, i.e.
http://localhost/myapp/login.xhtml
I could not find any way to accomplish this. Is there some way to do this in the <servlet-mapping>
? Do I need some additional framework?