Saturday, December 02, 2006

JSTL <c:choose> Tag

Selection/switching mechanism.
Taglib
: http://java.sun.com/jsp/jstl/core (Core)
Prefix: c
Attributes: none. Contains statements and an optional statement.
Example:
<c:choose>
<c:when test="${param.gender eq 'f'}">
// Stuff to do when gender = f
</c:when>
<c:otherwise>
// Stuff to do when none of the above when's tests true
</c:otherwise>
</c:choose>