Book Image

Mastering JavaServer Faces 2.2

By : Anghel Leonard
Book Image

Mastering JavaServer Faces 2.2

By: Anghel Leonard

Overview of this book

Table of Contents (20 chapters)
Mastering JavaServer Faces 2.2
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
The JSF Life Cycle
Index

A brief overview of the Facelets tags


Templating is a concept based on code reusability. Templates, or tiles, represent the portions of reusable code that can be puzzled together to obtain JSF pages. In order to accomplish this, we exploit a handful of tags from http://xmlns.jcp.org/jsf/facelets namespace.

Usually, prefixed with ui, these tags are listed as follows:

  • The <ui:composition> tag (TagHandler): This defines a page composition that can use a template (any content outside of this tag is ignored). The template attribute is optional and is used for indicating a template to which the enclosed content should be applied. Multiple compositions can use the same template, thus encapsulating and reusing the layout. Facelets will paste the enclosed content into the component's hierarchy, usually under UIViewRoot. The <ui:composition> tag is used in the following manner:

    <ui:composition template="template_path">
  • The <ui:define> tag (TagHandler): This defines the content...