Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在c:forEach循环生成标记。如何确定此循环上次是否正在运行,以便我可以根据我的要求生成一些额外的标记?
c:forEach
<c:forEach items="${sessionScope.leadListIs}" var="leadList"> <li>Test</li> <!-- if this loop running final time then --> <li>Last</li> <!-- end-if --> </c:forEach>
尝试
<c:forEach items="${sessionScope.leadListIs}" var="leadList" varStatus="status"> ${status.last ? '<li>Last</li>' : '<li>Test</li>'} </c:forEach>
问候