I started to use JSF 2.0 recently and I don't understand completely how I need to configure the javax.faces.webapp.FacesServlet to correctly handle resources. For example, If I decided to create a web application with .xhtml files and .jsp files and I want both them to use jsf technology how am I supposed to configure the jsf servlet to handle both? Sometimes I found example where the servlet url pattern is just /faces/* thanks!
1 Answers
1
votes
I suggest to use a suffix pattern as URL pattern like *.jsf
. If a Facelets file (.xhtml
) is present on the given view ID, then it will be served. Otherwise if a JSP file (.jsp
) is present on the given view ID, then it will be served. This also gives you the room to gradually upgrade from JSP to Facelets without the need to change URLs, so that you can ultimately get rid of those legacy JSPs in an easy way.