Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-22-2008, 04:08 PM   PM User | #1
cash1981
New Coder

 
Join Date: Feb 2007
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
cash1981 is an unknown quantity at this point
JSTL <c:choose> with JSF

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:

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 is offline   Reply With Quote
Old 05-22-2008, 04:29 PM   PM User | #2
cash1981
New Coder

 
Join Date: Feb 2007
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
cash1981 is an unknown quantity at this point
I figured it out.

I just removed JSTL and wrote:
Code:
<h:outputText value="yes" rendered="#{proeve.bestaatt}" />
<h:outputText value="no" rendered="#{!proeve.bestaatt}" />
cash1981 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:38 PM.


Advertisement
Log in to turn off these ads.