문제

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

도움이 되었습니까?

해결책

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

  • Java 1.5
  • Servlet 2.5
  • EL 2.1

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:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top