小编Nee*_*cks的帖子

Jsf 2.0- <ui:include> xhtml总是包含,即使渲染是假的

我有一个主页xhtml,我根据条件包括3个孩子xhtml.我面临的问题是,无论情况如何,Book.xhtml总是被调用.我将渲染条件更改为false或移出到另一个条件,但始终调用该文件由于其调用其支持bean而导致不必要的开销.请给我一个解决方案

<ui:composition template="/xhtml/baseLayout.xhtml">
    <ui:define name="browserTitle">
        <h:outputText value="HOME PAGE" />
    </ui:define>
    <ui:define name="header">
        <ui:include src="/xhtml/header.xhtml" />
    </ui:define>
    <ui:define name="bodyContent">

        <h:panelGrid width="100%"
            rendered="#{pogcore:isRoleAuthorized(BUNDLE.SUPER)}"  >
            <ui:include src="/xhtml/SuperUser.xhtml"  />
        </h:panelGrid>
        <h:panelGrid width="100%"
            rendered="#{pogcore:isRoleAuthorized(BUNDLE.MAINTENANCE)}" >
            <ui:include src="/xhtml/Maintenance.xhtml" />
        </h:panelGrid>

        <h:panelGrid width="100%"
            rendered="#{pogcore:isRoleAuthorized(BUNDLE.PRINT)}">
            <ui:include src="/xhtml/Book.xhtml" />
        </h:panelGrid>

    </ui:define>
</ui:composition>
Run Code Online (Sandbox Code Playgroud)

xhtml jsf jstl jsf-2 uiinclude

2
推荐指数
1
解决办法
9920
查看次数

标签 统计

jsf ×1

jsf-2 ×1

jstl ×1

uiinclude ×1

xhtml ×1