Deconstructing <c:forEach>

The <c:forEach> tag maps nicely into a for loop—the tag repeats the body of the tag for each element in the collection (and we use “collection” here to mean either an array or Collection or Map or comma-delimited String).

The key feature is that the tag assigns each element in the collection to the variable you declare with the var attribute.

image with no caption

Getting a loop counter with the optional varStatus attribute

image with no caption
image with no caption
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset