Facelets

Although both JSP and Faces technologies have been improved to work better together, Facelets eliminates the issues noted in Hans Bergsten's article "Improving JSF by Dumping JSP"[1] Facelets draws on some of the ideas from Apache Tapestry,[2][3] and is similar enough to draw comparison.

The project is conceptually similar to Tapestry's, which treats blocks of HTML elements as framework components backed by Java classes.

Nevertheless, directly using qualified tags is the most popular way of using Facelets in practice [6] and is the style most used in books and examples.

The following shows an example of a simple master template: templates/master_template.xhtml The above code contains a default HTML 'frame' and a single placeholder called body_content.

In addition to templating, Facelets provides support for re-use by letting the user include content that resides in a different file.

Besides re-using content at multiple locations, this can be used to break down a large Facelet into smaller parts.

The following shows an example of this: templates/master_template.xhtml The code above uses the tag to mark the point in the Facelet where content is to be inserted.