Jsf ui:include在选项卡视图中,另一个ui:include

Jsf ui:include在选项卡视图中,另一个ui:include,jsf,include,facelets,tabview,Jsf,Include,Facelets,Tabview,使用Tomcat 7.0.34、Primefaces 3.5和mojarra 2.1.25 我有以下文件“client.xhtml”: 文件client.inc(它是一个普通的xhtml,用于多个xhtml文件)如下所示:(简化) //客户信息资料 和“clientBilling.inc”:(我在其他几个xhtml文件中使用它) “clientBilling.inc”中的选项卡没有显示,但如果我将其从p:tabView上取下,内容就会显示出来。只是在这个老问题上被难住了,没有答案,我

使用Tomcat 7.0.34、Primefaces 3.5和mojarra 2.1.25 我有以下文件“client.xhtml”:


文件client.inc(它是一个普通的xhtml,用于多个xhtml文件)如下所示:(简化)


//客户信息资料
和“clientBilling.inc”:(我在其他几个xhtml文件中使用它)



“clientBilling.inc”中的选项卡没有显示,但如果我将其从p:tabView上取下,内容就会显示出来。

只是在这个老问题上被难住了,没有答案,我想试试

在clientBilling.inc中添加几行代码时,我可以实现这一点:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">

  <p:tab title="other tab">
  </p:tab>

  <p:tab title="another tab">
  </p:tab>

</ui:composition>

<ui:fragment xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:p="http://primefaces.org/ui">    
    <p:tabView>
        <p:tab title="Client Info">
            // Client info stuff
        </p:tab>

        <ui:include src="clientBilling.inc"/>
    </p:tabView>
</ui:fragment>
<p:tab title="other tab">
</p:tab>

<p:tab title="another tab">
</p:tab>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">

  <p:tab title="other tab">
  </p:tab>

  <p:tab title="another tab">
  </p:tab>

</ui:composition>