Techie Hints

A place where to find tech solution

JSTL Map Iteration

Simple for each loop supports map iteration.
<c:forEach var="country" items="${capitalList}"varStatus = "row">
    Country: ${country.key}  - Capital: ${country.value}
</c:forEach>
varStatus  attribute methids:
current getCurrent() The item (from the collection) for the current round of iteration
index getIndex() The zero-based index for the current round of iteration
count getCount() The one-based count for the current round of iteration
first isFirst() Flag indicating whether the current round is the first pass through the iteration
last isLast() Flag indicating whether the current round is the last pass through the iteration
begin getBegin() The value of the begin attribute
end getEnd() The value of the end attribute
step getStep() The value of the step attribute
Accessing the value through key:
${country['karanataka']}
Advertisements
%d bloggers like this: