This content has been marked as final.
Show 1 reply
-
1. Re: if condition always fails
akaine Jul 13, 2010 5:37 AM (in response to satyakatti)Khm... in JSTL if checks for a condition and executes/renders the contents if its true, there is no otherwise statement for it.
The if-else like structure in JSTL is achieved by using choose statement:
<c:choose> <c:when test="${user.role == 'member'}"> <p>Welcome, member!</p> </c:when> <c:otherwise> <p>Welcome, guest!</p> </c:otherwise> </c:choose>