Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Main differences between JSF 1.2 and 2.0

Tags:

java

jsf

I am in need of getting up to speed with JSF 2.0. I have found a nice and practical tutorial at JSF tutorial. This tutorial covers creating JSF applications using JSPs (JSF 1.2). At our place we are using JSF 2.0 and building with Facelets. When studying a tutorial using JSPs what are the pitfalls and differences I need to be aware of when having to do things with Facelets ?

like image 684
Nick H G Avatar asked Sep 29 '11 17:09

Nick H G


2 Answers

The great thing about Facelets vs. JSP as a view technology for JSF is that facelets respect the entire jsf lifecycle whereas with JSP you have the two lifecycles competing (JSF vs. JSP).

With JSP, you may be tempted to use other tag libraries (like JSTL) which may not behave as you are expecting due to the differences in the lifecycle. Some of the JSTL tags have been converted to facelet tags, but even then there are generally suitable pure JSF replacements for them (like ui:repeat in place of c:foreach)

If you are doing JSF 2.0, use facelets and you'll never look back.

like image 141
digitaljoel Avatar answered Sep 20 '22 05:09

digitaljoel


Facelets are generally nice to work with.

The major difference in JSF 2.0 compared to earlier versions is that you can directly invoke Java methods easily from EL, making it much easier to do logic operations and information passing in the JSF snippets themselves.

like image 32
Thorbjørn Ravn Andersen Avatar answered Sep 22 '22 05:09

Thorbjørn Ravn Andersen