javajsf-2richfacesfaceletsjava-ee-5

Can i use Facelets with JSF2.0 - Richfaces 3.3.3 in Java EE5


I'm restricted to develop the site in Java EE5 and would like to use the tools like Facelets, JSF2.0 and RichFaces 3.3.3

Can i use the Facelets in above environment? or Should i go with JSP only?

Please provide your comments.

Thanks, Chuck


Solution

  • As you can find in our JSF wiki page, JSF 2.0 has the following minimum requirements:

    A Java EE 5 container covers all of those already exactly.

    As to Facelets, it's since JSF 2.0 bundled in JSF library itself as default view technology and has deprecated JSP. So, as to using JSF 2.0 (and implicitly also Facelets 2.0), with a Java EE 5 container you're already fully set. You don't need an additional Facelets 1.x JAR file. You need to keep in mind that an unmodified Java EE 5 container ships by default with JSF 1.2. You'd need to replace/upgrade/disable the container-bundled JSF 1.2 libraries in order to use JSF 2.0.

    However, there is one more thing you need to take into account with RichFaces 3.x. RichFaces 3.x is in turn officially not compatible with JSF 2.0. You have then 2 options:

    1. Use a modified version of RichFaces 3.x specifically for JSF 2 environments. You only need to disable the JSF 2.0 own Facelets and fall back to legacy Facelets 1.x designed for JSF 1.2 by explicitly supplying a Facelets 1.x JAR along with the webapp. You can find all download links and configuration details in this JBoss wiki.

    2. Upgrade to RichFaces 4.x. The JBoss wiki has a migration guide as well. RichFaces 4.x is fully JSF 2.0 compatible and doesn't require fall back to Facelets 1.x.

    See also: