JSP同时遍历两个集合

<c:forEach items="${listOne}" var="item" varStatus="loop"> 
                <tr>
                 <td>${item.id}</td>
                 <td>${item.name}</td>
                 <td>${item.age}</td>
                 <td>${listTwo[loop.count-1].property}</td>
                </tr>
</c:forEach>

Name of the exported scoped variable for the status of the iteration. Object exported is of 
type javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility.

index  当前这次迭代从 0 开始的迭代索引

count  当前这次迭代从 1 开始的迭代计数

上一篇:《精通 ASP.NET MVC 3 框架(第三版)》----第1章 设计思路 1.1 Web开发简史


下一篇:人人都是Serverless架构师之弹幕应用开发实战