...

View Full Version : JSTL <c:choose> with JSF



cash1981
05-22-2008, 04:08 PM
Hello.

I have a JSF/Seam application and I need to write yes if a boolean is true, and no if a boolean is false.

I have tried everything, but it is always displayed No.
#{proeve.bestaatt} is a boolean value and it prints true or false.
Here is my sample code:



<c:choose>
<c:when test="${proeve.bestaatt}">
Yes
</c:when>
<c:otherwise>
No
</c:otherwise>
</c:choose>


I have tried
<c:when test="#{proeve.bestaatt}">
and
<c:when test="${proeve.bestaatt eq 'true'}">
and
<c:when test="#{proeve.bestaatt == 'true'}">

But nothing works.
Please help

cash1981
05-22-2008, 04:29 PM
I figured it out.

I just removed JSTL and wrote:


<h:outputText value="yes" rendered="#{proeve.bestaatt}" />
<h:outputText value="no" rendered="#{!proeve.bestaatt}" />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum