This recipe lists the main steps for installing Facelets under JSF 1.2. For JSF 2.0, Facelets is bundled, therefore no installation is needed.
To start with, you need to download Facelets from https://facelets.dev.java.net/. It is recommended to download the latest stable release.
Once you have downloaded the Facelets distribution, you can install it under your project by following the given steps:
/WEB-INF/lib
folder.init
parameter(s) to the web.xml
file, as follows:<context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.xhtml</param-value> </context-param>
Add the FaceletViewHandler
to the faces-config.xml
file, as follows:
<application> <locale-config> <default-locale>en</default-locale> </locale-config> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application>
Done! Now, you are ready to explore Facelets in your JSF projects.