【发布时间】:2013-12-26 23:53:49
【问题描述】:
在我的 JSF 页面中,我使用 <c:choose><c:when> 标记有条件地显示内容。但是,它不起作用,因为它似乎总是评估 false。
例如
<h:outputText value="#{pollInfo.active} -" />
<c:choose>
<c:when test="#{pollInfo.active}">
<h:outputText value="Active" />
</c:when>
<c:otherwise>
<h:outputText value="Deactive" />
</c:otherwise>
</c:choose>
肯定有一些带有active=true 的项目,由<h:outputText> 确认,但它只为所有项目打印Deactive。你可以在下图中看到实际的输出:
这是怎么引起的,我该如何解决?
【问题讨论】:
标签: jsf jsf-2 jstl conditional-rendering