The decorate
tag is identical to the composition
tag, except that ui:decorate
, unlike ui:composition
, does not disregard all content outside of the tag. The decorate
is useful when you want to decorate some content in a page, for example, you might want to decorate a list of items, like this:
<ui:decorate template="/layout.xhtml">
<ui:define name="listHeading">
<ui:include src="shared/listHeading.xhtml"/>
</ui:define>
<c:forEach items="#{items}" var="item">
...
</c:forEach>
...
</ui:decorate>
Because JSF does not disregard everything outside of the
ui:decorate
tag,
ui:decorate
can be used to decorate pieces of a page.