Documentation
FaceletsTools

Search 

Contents

1. Introduction
2. Getting Started
Selected 3. Facelets Concepts
4. Document Types
5. Design View Support
6. Code View Support
7. Keyboard Shortcuts
8. Tag Object Toolbars
9. Property Inspectors
10. Facelets Tag Reference

3. Facelets Concepts

Contents > Facelets Concepts > Composite View Design Pattern

Composite View Design Pattern

Facelets is based on the Composite View Design Pattern. This means that sections of a page or even pages themselves can be reused by other pages. The Sun Java Blueprints Catalogue defines a composite view as follows:

"A Composite View is a view built using other reusable sub-views. A single change to a sub-view is automatically reflected in every composite view that uses it. Furthermore, the composite view manages the layout of its sub-views and can provide a template, making consistent look and feel feel easier to achieve and modify across the entire application."
(Sun Java Blueprints Catalogue)

What is a "Facelet"?

A "Facelet" is a reusable section of content or a sub-tree of components on a JSF page that can itself be composed of other Facelets. In this sense, a Facelet is a composite view element that can easily be combined with other Facelets to build a JSF view that will be rendered to the user.