且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JSF通过Bean来查看失败

更新时间:2023-12-04 18:07:40

问题似乎是JSTL和JSF之间的冲突,如以下几个线程所述:

The problem turns out to be the *** between JSTL and JSF, as noted on several threads:

JSTL c:选择c:when在JSF页面中无法使用

指定< ui内的元素的条件渲染:repeat&gt ;? < c:if>似乎不起作用

因此,我重写了不使用JSTL的循环,它摆脱了原始问题中的紧迫问题:

So I've rewritten the loop not to use JSTL and it gets rid of the immediate problem in the original question:

        <ui:repeat var="blockName" value="#{page1Bean.blockNames}" varStatus="status">
            <ui:fragment rendered="#{blockName == 'block1'}">
                <ui:include src="#{page1Bean.theBlockName}" >
                    <ui:param name="bean" value="#{page1Bean.myBean}"/>
                </ui:include>
            </ui:fragment>

            <ui:fragment rendered="#{blockName != 'block1' }">
                <ui:include src="block2.xhtml" />
            </ui:fragment>

        </ui:repeat>

(这在功能上不等同于已损坏的目的,但要点是它不使用JSTL).

(This isn't functionally equivalent to the intended purpose of the broken one however the point is it doesn't use JSTL).