我宣布了一个名为 item
的变量并创建捆绑。它包含一些数据如下
StudentAdd=student/Create.xhtml
StudentEdit=student/Edit.xhtml
StudentList=student/List.xhtml
DepartmentAdd=department/Create.xhtml
我希望通过更改变量数据来包含不同的xhtml页面
这是我的xhtml代码
<c:forEach items="#{ajaxBean.chcekItem}" var="item" varStatus="loop">
<p:tab id="#{item}" title="#{item}" closable="true">
<ui:include src="#{bundle.#{item}}"/>
</p:tab>
</c:forEach>
我可以尝试以上方式但显示以下错误消息...
/index.xhtml @57,66 src="#{bundle.#{item}}" The identifier [#] is not a valid Java identifier as required by section 1.19 of the EL specification (Identifier ::= Java language identifier). This check can be disabled by setting the system property org.apache.el.parser.SKIP_IDENTIFIER_CHECK to true.
答案 0 :(得分:1)
而不是<ui:include src="#{bundle.#{item}}"/>
使用<ui:include src="#{bundle[item]}"/>