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>

3 comments:

reyt said...

The World Leading wow power leveling and wow gold wow power leveling

Jwalant said...

This is a good example of choose-when-otherwise block in JSTL. If you want to learn more about this tag and other commonly used JSTL tags, you can go to JSTL Tutorial

Jwalant said...

This is a good example of choose-when-otherwise block in JSTL. If you want to learn more about this tag and other commonly used JSTL tags, you can go to JSTL Tutorial