I’m using JSTL to loop over a list of shop objects. It looks like the following:
<c:forEach items="${shops}" var="shop">
<div class="odd">
<li class="table-shop">${shop.name}</li>
</div>
</c:forEach>
Now I want to be able to get the shop’s position in the list. For example if it’s the first shop, I’d like to print out 0 next to the name of the shop.
What’s the best way I do this?
Use
varStatus, e.g.: