Friday 13 January 2012

JSF:Facelet: How to use <f:metadata> with a template

view01.xhtml
    <ui:composition template="template.xhtml">
        <ui:define name="metadata">
          <f:metadata>
            <f:viewParam name="id"/>
          </f:metadata>
        </ui:define>
        <ui:define name="content">
            <h1>The big news stories of the day</h1>
        </ui:define>
    </ui:composition> 
template.xhtml
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:f="http://java.sun.com/jsf/core"
          xml:lang="en" lang="en">
     
    <body>
    <f:view>
       
            <ui:insert name="metadata"/>
       
        <div id="container">
            <ui:insert name="content"/>
        </div>
    </f:view>
    </body>
    </html> 

References

No comments:

Post a Comment