I have three values and I want one component to be rendered in the case of first two values and another component for the third value
Below, I have my page :
page.xhtml
<ui:repeat value=#{bean.value} var="data">
<c:choose>
<c:when test="#{data.thirdValue == 'content'}">
<h:outputText value="Wrong value"/>
</c:when>
<c:otherwise>
Correct!
</c:otherwise>
</c:choose>
</ui:repeat>
This is how my page is defined. I have also added the following namespace : xmlns:c="http://java.sun.com/jsp/jstl/core
.
I tested whether, the value defined inside test for <c:when>
returns "true" or "false" and it does.
My problem is that the <c:when>
is never evaluated. The <c:otherwise>
value is always rendered. Am I missing something? Is it because of the the conditional rendering being inside <ui:repeat>
that the when is not evaluated?
Any help will be most appreciated. Thanks in advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…