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>
|