Remove Facelets 1.x FaceletViewHandler from faces-config.xml.Remove Facelets 1.x JAR from /WEB-INF/lib.If you’re using Facelets 1.x as view technology and want to use the JSF 2.0 supplied Facelets 2.0, then you need to do the following additional steps: So if you want to come from or go to *.jsp, then you still need to include it in the viewid the JSF 1.x way. You only need to keep in mind that the new JSF 2.0 provided implicit navigation doesn’t scan for the presence of the file, it will go to outcome.xhtml anyway.
This provides you room to gradually convert from JSP to Facelets behind the scenes without changing the URL’s.īut if you’re using a prefix url-pattern, like /faces/* and you want to gradually upgrade from JSP to Facelets, then you really have to change it to *.jsf and possibly also all links in the existing JSP pages. If you’re already using a suffix url-pattern for the FacesServlet, like *.jsf, then it’s good to know that the FacesServlet will first scan for *.xhtml file and if it is not present, then scan for *.jsp file.
If you’re using JSP 2.x and want to keep using it, then you basically don’t need to change anything else. Note: when you’re using Servlet 3.0 or newer, use the namespace domain instead of throughout the above XML snippet. JSF 2.0 won’t work on 2.4 or lower ( although it’s hackable). Note: when you’re using JSF 2.2 or newer, use the namespace domain instead of throughout the above XML snippet.Įnsure that root declaration of web.xml already complies at least Servlet 2.5.
Update root declaration of faces-config.xml to comply JSF 2.0 spec. Drop JSF 2.0 JAR’s in /WEB-INF/lib (if JSF 1.2 was servletcontainer-supplied, you might want to change the classloading policy to load webapp libraries first before servletcontainer libraries, see also JSF2 classloading issues in application servers).Remove JSF 1.2 JAR’s from /WEB-INF/lib (if any).Regardless of the view technology switch, at least the following steps should be done:
Double this if you also have custom components. JSP 2.x to Facelets 2.0 = Lot of effort.
Facelets 1.x to Facelets 2.0 = Little effort.Painfulness of upgrading JSF 1.2 to 2.0 depends on the view technology which you are currently using and which you want to use.