Automatic sequence number for <c:forEach>

<!--
  varStatus property in c:forEach. Points to a string that references an object. map.put("vs", Object); This object records some information about the currently traversed element:
     getIndex(): returns the index.
     getCount() from 0 : Returns the count. Starting from 1
     isLast(): Is it the last element
     isFirst(): Is it the first element

-->
    <c:forEach items="${list}" var="num" varStatus="vs">
        <tr >
            <td>${num}</td>
            <td>${vs.index}</td>
            <!-- AutoNumber-->
            <td>${vs.count}</td>
            <td> ${vs.first}</td>
            <td>${vs.last}</td>
        </tr>
    </c:forEach>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326448807&siteId=291194637