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

ui:define

The Define tag is a templating tag that defines named content to be inserted into a template. The name attribute value must match that of a ui:insert tag in the target template for the named content to be included.

Example:

<h:outputText value="#{dateBean.today}">
  <s:convertDateTime dateStyle="full" type="both" />
</h:outputText>
<p><strong>template.jsf</strong></p>
<h2><ui:insert name="title" /></h2>
<p><strong>template.jsf</strong></p>
<ui:composition template="template.jsf">
  <ui:define name="title">Hello World!</ui:define>
</ui:composition>

HTML Output

<p><strong>composition.jsf</strong></p>
<h2>Hello World!</h2>

Tag Attributes

name String
Required
The name attribute specifies the literal name of the definition and must match the name of a ui:insert tag in a target template for the content to be included in that template.