Documentation
Facelets Tools

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.

UI Design 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.

Facelets Template (template.jsf)

<html>
<head>
<title><ui:insert name="title" /></title>
<body>
<h2><ui:insert name="header" /></h2>
<ui:insert name="message" />
</body>
</html>

Facelets Template Client (composition.jsf)}

<html>
<head>
<title>Welcome</title>
</head>
<body>
<h2>Hello World!</h2>
How are you today?
</body>
</html>

Tag Attributes

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