Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
The definitive guide to Apache MyFaces and Facelets
Wadia Z., Marinschek M., Saleh H., Byrne D., Apress, Berkeley, CA, 2008. 400 pp. Type: Book (9781590597378)
Date Reviewed: Sep 28 2009

This book is a detailed guide to JavaServer Faces (JSF), Tomahawk, and some other critical projects, for intermediate to advanced users. It provides specification-level details, coherent examples, and downloadable source code from the publisher’s Web site (http://www.apress.com/book/view/9781590597378).

Readers are required to have a basic understanding of the controller servlet concept and hypertext transfer protocol (HTTP) get and post methods. The book explains the logical progression of JSF technology from servlets to JavaServer Pages (JSP), to Struts programming. JSF is a component-oriented, event-driven framework that focuses on rapid development of Web applications. JSF makes it much easier to code, without having to do repetitive JSP coding.

The first chapter covers the JSF life cycle: creating or restoring a view with user input; handling requests for validation; application handling logic; and final rendering. Unfortunately, the book lacks a comprehensive appendix of JSF Hypertext Markup Language (HTML) and JSF core tags. The Apache Tomahawk project provides a series of ready-to-use JSF components for rapidly creating rich graphical user interface (GUI) applications.

Chapter 2 presents examples of several useful components from Tomahawk: calendar (with popup feature), DataScroller, JSCookMenu (similar to the menu bar of a desktop application), and schedule component (similar to Outlook or other weekly calendar schedulers). All components require managed beans (mapped to a JSF configuration file), with getters and setters for input/output (I/O).

The next chapter presents Facelets, including downloading and configuring Facelets for Web applications, with examples for supporting the unified expression language. It elaborates on the following main advantages of Facelets: the pages are written using standard Extensible HTML (XHTML), which allows designers to freely design the pages, and Facelets provides templating for JSF. Templating allows common areas of Web applications, such as headers, footers, and navigation menus, to be placed in separate files that can be included on all pages--this greatly simplifies maintenance by promoting reuse. This chapter also elaborates on the use of Facelets tags--ui:composition, ui:define, ui:insert, and ui:include. Appendix A provides a complete listing of Facelets for easy reference. One of the other important features of Facelets described is the user’s ability to create custom components that can be registered in the custom tag library for later reuse. The chapter presents a couple of handy examples of creating custom user interface (UI) components, registering tags in the custom tag library, and using the fancy composite component in Web applications.

Apache MyFaces Trinidad--the open-source code donated by Oracle to the Apache Software Foundation (ASF)--is presented in chapter 4. Trinidad provides feature-rich client components, user interfaces, and client-side validators and converters that extend the JSF framework capabilities for developing quality enterprise GUI products. Trinidad setup and configuration is done through trinidad-config.xml, with a couple of context parameters specified in the application’s web.xml file. Off-the-shelf Trinidad offers support for several components, some of which are covered in the text: pageFlowScope, for passing data between application pages (such as session scope beans); partial page rendering for Ajax-enabled applications; the dialog framework for building user-interactive pages with the capability of capturing and passing data; and charts--bar, line, and pie charts for event handlers and listeners. Trinidad’s client-side converters and validators are handy because errors can be captured on the client side, to avoid a round trip. Although chapter 4 provides several code samples, the explanation is often poor. A complete list of components, demo applications, and developer resources is available on the Apache MyFaces Trinidad Web site (http://myfaces.apache.org/trinidad/download.html).

Chapters 5 and 6 present Apache Orchestra and Tobago. Relatively new to the JSF family, Orchestra addresses the need to manage bean scope beyond the typical request, session, and application levels. Orchestra provides a conversation scope for Web applications, by keeping managed beans available throughout multiple requests and multiple pages. Orchestra relies on the Spring framework for implementing this conversation functionality. Tobago aids the development community with a well-designed set of user interface components and HTML-like controls based on JSF, for creating Web applications. The topics covered in the book range from configuring Tobago to building input controls, menus, toolbars, and popups.

Chapter 7 covers common development pitfalls and anti-patterns, and addresses issues with JSF development, such as performance, tight coupling, cache management, and thread safety. The authors emphasize design patterns that improve performance by reducing trips to the database for data retrieval and isolating the view from the database connection part. Several other recommendations that encourage good development design, such as thread safety and view state encryption with secure sockets layer (SSL), are also presented.

Finally, the book ends with Appendices B and C: “View State Encryption” and “Custom Dependency Injection.”

In summary, this book is a good guide for learning JSF. Although the book does not address whether various JSF components from Tomahawk, Trinidad, and other projects can be combined and used together in a single project, it sounds like most components can work in combination. The book lacks visuals such as pictures and diagrams for GUI component examples, but the similarity in the organization and approach of every chapter makes it easy for the reader to understand.

Reviewers:  Srini RamaswamyAshish Makhijani Review #: CR137327 (1009-0889)
Bookmark and Share
  Featured Reviewer  
 
Scripting Languages (I.7.2 ... )
 
 
Systems And Software (H.3.4 )
 
Would you recommend this review?
yes
no
Other reviews under "Scripting Languages": Date
Writing CGI applications with Perl
Meltzer K., Michalski B., Addison-Wesley Longman Publishing Co., Inc., Boston, MA, 2001.  560, Type: Book (9780201710144)
May 1 2001
 Essential PHP fast: building dynamic Web sites with MySQL
Stobart S., Springer-Verlag New York, Inc., Secaucus, NJ, 2002.  256, Type: Book (9781852335786)
Mar 18 2003
PHP and MySQL manual: simple, yet powerful Web programming
Stobart S., Vassileiou M., Springer-Verlag, 2004.  590, Type: Book (9781852337476)
Apr 1 2004
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy