0

I am trying to include a xhtml page into a Template content.Such that the content of template may contain the output of that xhtml file. I don't how to include this,so please give me some suggestions.

`index.xhtml

    <ui:composition template="newTemplate.xhtml">
         <ui:define name="content"   ></ui:define></ui:composition>

</h:body>`

newTemplate.xhtml

    <div id="top">
        <ui:insert name="top">Top</ui:insert>
    </div>

    <div id="content" class="center_content">
        <ui:insert name="content">Content</ui:insert>
    </div>

    <div id="bottom">
        <ui:insert name="bottom">Bottom</ui:insert>
    </div>

</h:body>
`
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
user007
  • 29
  • 1
  • 1
  • 8
  • 1
    possible duplicate of [How to include another XHTML in XHTML using JSF 2.0 Facelets?](http://stackoverflow.com/questions/4792862/how-to-include-another-xhtml-in-xhtml-using-jsf-2-0-facelets) – BalusC Sep 16 '13 at 11:05

1 Answers1

1

Template:

<ui:composition>  
       <ui:insert name="wa_content"></ui:insert>
</ui:composition>

xhtml page (with another include):

<ui:composition template="template_name">

        <ui:define name="wa_content" >
              <ui:define name="buttonsPanelBody" >
                        <ui:include src="other_xhtml_page_name.xhtml" />
              </ui:define>
        </ui:define>
</ui:composition>

other_xhtml_page_name.xhtml

<ui:composition>
         your code
</ui:composition>
Iker Aguayo
  • 3,980
  • 4
  • 37
  • 49