【问题标题】:How to include a xhtml page into a Template in jsf如何将 xhtml 页面包含到 jsf 中的模板中
【发布时间】:2013-09-20 06:16:41
【问题描述】:

我正在尝试将 xhtml 页面包含到模板内容中。这样模板的内容可能包含该 xhtml 文件的输出。 我不知道如何包含这个,所以请给我一些建议。

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

【问题讨论】:

标签: jsf templates facelets


【解决方案1】:

模板:

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

xhtml 页面(带有另一个包含):

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

【讨论】:

    猜你喜欢
    • 2014-06-21
    • 2012-12-12
    • 2013-06-07
    • 2012-09-15
    • 2011-08-12
    • 1970-01-01
    • 2020-12-14
    • 2012-04-15
    • 2013-04-15
    相关资源
    最近更新 更多