Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    New Coder
    Join Date
    Feb 2007
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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}" />


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •