Search code examples
templatesjsffaceletstemplate-engine

Default content in facelets template with empty ui:define


Is it valid to expect that facelets template will use a default content in page which use the template but uses an empty ui:define?

template:

<ui:insert name="header">
    default content here <!-- is it valid default content? -->
</ui:insert>

page which implements the template:

<ui:define name="header">
   <!--nothing in page defined here but expecting that default content from template will be substituted in place-->
</ui:define>

The default content is not shown though in this case (the comment is not there in the real page)


Solution

  • No it will not show the default content in this case, it works as you defined it (pun intended)...

    There is a <ui:define name="header">...</ui:define>, so there is something defined. That it does not contain anything does not mean it will display the default content. Remove the define and the default content is shown. As is according to the specs afaik.