Home < c:forEach>如何终止循环
Post
Cancel

< c:forEach>如何终止循环

1
2
3
4
5
6
7
8
9
10
<c:set var="exitId" value="0"/>
<c:forEach items="${opinions }" var="map" varStatus="status">
    <c:if test="${exitId eq '0'}"><!--for循环里面的操作都写在c:if中-->
        <td>在循环</td>
        <!--如果下标等于5则不会循环出td-->
        <c:if test="${status.index eq '5'}">
            <c:set var="exitId" value="1"/>
        </c:if>
    </c:if>
</c:forEach>
This post is licensed under CC BY 4.0 by the author.