Documentation
FaceletsTools

Search 

Contents

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

10. Facelets UI Tag Reference

Contents > Facelets UI Tag Reference > ui:composition

ui:composition

The UI Composition tag is a templating tag that wraps content to be included in another Facelet. Any content outside of the UI Composition tag will be ignored by the Facelets view handler. Any content inside of the UI Composition tag will be included when another Facelets page includes the page containing this UI Composition tag. See also ui:include.

Templating Tip

If the template attribute is specified, the JSF page containing the composition tag will display the content of the associated template. If the composition tag contains ui:define tags, the content of these tags will be inserted into the template where matching ui:insert tags can be found. The template page can use a nameless ui:insert tag to insert all the content within the composition tag.

Example:

<p><strong>template.jsf</strong></p>
<h2><ui:insert name="title" /></h2>
<p><strong>composition.jsf</strong></p>
This text will be ignored.
<ui:composition template="template.jsf">
  <ui:define name="title">Hello World!</ui:define>
</ui:composition>
This text will be ignored.

HTML Output

<p><strong>composition.jsf</strong></p> <pre id="line1"><h2>Hello World!</h2>  

Tag Attributes

template String
 
The path to the template to be populated by the content within the composition tag.