同时遍历2个集合


<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 开始的迭代计数

关于varStatus的详细解读:http://luoke920.iteye.com/blog/258815

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM