JSP EL表达式 for循环获取索引 c:foreach
在c:foreach中使用varStatus属性,然后再循环中任意位置使用index属性
<c:forEach items="${categoryList}" var="category" varStatus="idxStatus">
<c:out value='${idxStatus.index}'/>
</c:forEach>
<c:forEach items="${categoryList}" var="category" varStatus="idxStatus">
<c:out value='${idxStatus.index}'/>
</c:forEach>