如何在JSTL中获取数组或者list对象的索引值(index)

<c:forEach items="${productList}"
               var="products"   varStatus="status">
      产品序号:${status.count}&nbsp;产品名称:${products.name}
</c:forEach>

上面代码中的varStatus是关键,${status.count}即是我们要的数组的索引值。

原文地址:https://www.cnblogs.com/liughost/p/3910478.html