O'Reilly logo

Facelets by Robert Swarr

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 1. Introducing Facelets: A Better JSF ViewHandler

1.1 What Is Facelets?

Facelets is a Java Server Faces templating framework, based on a few simple principles: creating a tree of UIComponent objects and interweaving content completely within the JavaServer Faces request processing lifecycle. In addition to being totally JSF-centric, it incorporates numerous developer-friendly features. It supports reusable templates that weave in template client or default content. It provides a view compiler that processes all Faces and HTML tags as full members of the UIComponent tree. It enables creation of reusable components without writing a single line of Java code. It supports coding JSF components as "jsfc" attributes, allowing the view files to be created with any web development tool. It eliminates marker tags such as f:view and f:subview, which do not represent presentation components, but instead mediate the technology gap between JSP and JSF. Finally, it composes and renders components completely within the JSF lifecycle. Jacob Hookom, the creator of Facelets, references these simple founding principles in the Facelets Developer Documentation:

Facelets is founded on simple principles and the API is a solid reflection of it. The framework is focused on one specific task, and that's tree creation and content interweaving—taking an XHTML or XML document and using it as a set of instructions to populate a tree of UIComponents.

His statement references the three core ideas around which ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required