您的位置:首页 > Web前端 > JavaScript

JSP同时遍历两个集合

2018-03-14 18:04 106 查看
<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 开始的迭代计数
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  JSP