简体   繁体   English

如何在JSP中迭代映射对象的列表项列表?

[英]How to iterate List of List items of Mapped objects in JSP?

I have a requirement of displaying data from List> in JSP. 我需要在JSP中显示“列表”中的数据。 so how to do it in JSP? 那么如何在JSP中实现呢? What would be the best approach to do that? 这样做的最佳方法是什么? Eg; 例如;

List<Map> list=new ArrayList<Map>();

List of Mapping objects... we will add list objects to mainList. 映射对象列表...我们将列表对象添加到mainList。 It will be like this.. 就是这样

List<List> mainList=new ArrayList<List>();

Thanks in advance!!! 提前致谢!!! Earlier reply Highly Appreciated... 较早的答复高度赞赏...

Use <c:forEach> 使用<c:forEach>

for List<List> list 用于List<List> list

<c:forEach items="list" var="listOuter">

  <c:forEach items="listOuter" var="listInner">

  </c:forEach>

</c:forEach>

Also See 另请参阅

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM