简体   繁体   中英

How to include a xhtml page into a Template in jsf

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>
`

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM