What Is Facelets?
Facelets is a powerful but lightweight page declaration language that is used to build JavaServer Faces views using HTML style templates and to build component trees. Facelets features include the following:
The advantages of Facelets for large-scale development projects include the following:
In short, the use of Facelets reduces the time and effort that needs to be spent on development and deployment.
Facelets views are usually created as XHTML pages. JavaServer Faces
implementations support XHTML pages created in conformance with the
XHTML Transitional Document Type Definition (DTD), as listed at
JavaServer Faces technology supports various tag libraries to add components to a web page. To support the JavaServer Faces tag library mechanism, Facelets uses XML namespace declarations. Table 8-1 lists the tag libraries supported by Facelets.
Table 8-1 Tag Libraries Supported by Facelets
Facelets provides two namespaces to support HTML5-friendly markup. For details, see HTML5-Friendly Markup.
Facelets supports tags for composite components, for which you can declare custom prefixes. For more information on composite components, see Composite Components.
The namespace prefixes shown in the table are conventional, not mandatory. As is always the case when you declare an XML namespace, you can specify any prefix in your Facelets page. For example, you can declare the prefix for the composite component tag library as
instead of as
Based on the JavaServer Faces support for Expression Language (EL) syntax, Facelets uses EL expressions to reference properties and methods of managed beans. EL expressions can be used to bind component objects or values to methods or properties of managed beans that are used as backing beans. For more information on using EL expressions, see Using the EL to Reference Managed Beans.