Saturday, December 02, 2006

JSTL <c:forEach> Tag

Used as a for loop in JSP to process elements of a collection.
Taglib
: http://java.sun.com/jsp/jstl/core (Core)
Prefix: c
Attributes:
items | String = collection to operate on.
var| String = variable holding the current item in iteration.
varStatus| String = variable holding the LoopTagStatus object.
begin| String = first index, 0-based.
end| String = last index, 0-based.
step| String = increment value, numeric.
Example:
<c:forEach items="${headerValues}" var="h">
<c:out value="${h.key}" />
</c:forEach>