Consider a nested template:
Base.xhtml:
...
<h:outputText value="#{uiParamter}"/>
<ui:insert name="header"/>
... etc.
Layout.xhtml:
<ui:composition template="Base.xhtml">
...
<ui:insert name="content"/>
... etc.
</ui:composition>
When now defining a template client like this:
<ui:composition template="Layout.xhtml">
<ui:define name="header"> foo </ui:define>
<ui:define name="content"> foo2 </ui:define>
<ui:param name="uiParameter" value="foo3"/>
</ui:composition>
does one have to forward the <ui:param> or <ui:define> in the Layout.xhtml to the Base.xhtml template by redefining it. e.g:
<ui:param name="uiParameter" value="#{uiParameter}">
<ui:define name="header">
<ui:insert name="header"/>
</ui:define>
One could also rephrase this question as: “Do template parameters behave cascading?”
The answer is YES. I’ve run the following code on JBoss AS 7.0:
nest1.xhtml:
nest2.xhtml:
nest3.xhtml:
which was rendered as: