One Minute Bottom Line
|This book is a thorough and detailed reference of JSF 2.0, co-written by one of the authorities on JSF, co-spec lead of JSR-314, Ed Burns. If you’re looking for the “one-stop-shop” definitive JSF 2.0 book and don't feel like reading the entire spec, then this is it. Covers JSF 1.1 to 2.0, focusing on the enhancements in 2.0. Highly recommended.
JavaServer Faces (henceforth, JSF), is a key technology in the Java EE 5/6 platform. It is a component-based MVC presentation layer framework that is very popular now in the Java community. JSF 2.0 is a major re-write of JSF 1.2 adding features like AJAX functionality, Facelets view templates, bean validation and bookmarkability. Much of these new features were influenced by JBoss Seam, Hibernate Validator and RichFaces frameworks.
What is JSF? “JSF combines an MVC design approach with a powerful, component-based UI development framework that greatly simplifies Java EE Web development while using existing markup and servlet technologies.”
This review is of JavaServer Faces 2.0: The Complete Reference by Ed Burns and Chris Schalk. The book was published December 2009. The target audience is Java developers who want to learn the latest version of the proven component-based Java EE presentation tier framework and now with built-in AJAX functionality. Some experience with JSF 1.x, RichFaces, Hibernate Validator, Seam and Facelets would be very helpful and considered prerequisites for this book. You will need Java SE 6, Maven 2 to build the examples and Glassfish 2.1 or 3.0 or ApacheTomcat 6.0 to run the example apps.
What I liked:
One very valuable feature of this book was the section that covers how to configure your JSF app via the faces-config.xml file. There are numerous examples for various different elements. The data in that section for each element states which versions of JSF the usage rules are applicable for which is very helpful as a practical day-to-day programming guide.
I learned about a tag in JSF 1.2 that I have no experience with: <f:phaseListener>. This may be useful one of these days on an existing JSF 1.2 project.
I was happy to see that there were separate chapters on Facelets, JSF lifecycle, navigation model, UI components, conversions and validations, and managed beans and EL. The authors went into great detail in these “foundational” sections to make sure the reader fully understands the basics prior to moving onto more advanced concepts like portlets, AJAX, PhaseListeners and RenderKits.
There was excellent coverage of new features and changes in JSF 2.0 and overall excellent technical editorial work; there were very few grammatical and syntactical mistakes compared to other Java books I’ve read. The reference section on the standard component library in JSF is very exhaustive and thorough. There are examples and attribute lists for most tags.
The book provides a history/evolution of presentation tier technologies and coverage of competing presentation frameworks like Apache Struts and Spring MVC. The notes, expert group insights and tips throughout the chapters are very valuable in gaining additional insight and warnings so when you actually start writing an app using JSF 2.0, you’ll be ready. In addition, since there are many JSF 1.2 apps in production deployment today, there are many JSF 1.2 tips as well which is an added bonus.
While describing the JSF life cycle, the authors use server-side UI component tree diagrams to help understand what’s going on internally and behind the scenes, when the user submits a form, for example, and the various phases of the life cycle are exercised. There are also small tidbits of historical information like “MVC design paradigm described by Trygve Reenskaug in Smalltalk in 1979.”
Overall, I think this is a great book to learn the concepts and internals of JSF 2.0 as well as to use day-to-day on projects as a reference.What I disliked:
There was no reference or credit to JBoss Seam or RichFaces in the index, even though these two frameworks heavily influenced the re-design of JSF 2.0. There are quite a few references to Ruby on Rails in the context of “don’t repeat yourself” and “convention over configuration” and “the name ‘flash‘ and the concept behind it are taken directly from Ruby on Rails.” Give credit where credit is due.
I was unable to find any sections on backwards compatibility with JSF 1.x with the exception of JSP support being included in JSF 2.0. This is of course going to be of interest to development teams that are upgrading from JSF 1.2 to 2.0 (or possibly using both APIs). There were also no references section or bibliography. This is standard for most technical books.
How to improve:
This book is close to perfect, especially as a reference. It’s a great alternative to the JSF 2 spec. I would recommend addressing the items mentioned above in the “what I disliked” section. Also it would be nice to mention any new features in upcoming versions and popular competing MVC/presentation technologies in the Java space like Wicket or Flex and comparing functionalities/features of these software libraries.