开发者

How to use list object in <c:forEach tag?

开发者 https://www.devze.com 2023-01-21 02:13 出处:网络
I have two list objects in request. Now I want to use them in jsp page by the following approach: <c:forEach items=\"${listA}\" var=\"A\">

I have two list objects in request. Now I want to use them in jsp page by the following approach:

<c:forEach items="${listA}" var="A">
<tr><td>${A.propA}</td><开发者_StackOverflow社区td>${listB[A.index].propB}</td>
</c:forEach>

Is that possible? Thanks

I got the correct approach:

<c:forEach items="${listA}" var="A" varStatus="status">
<tr><td>${A.propA}</td><td>${listB[status.index].propB}</td>
</c:forEach>


Yes try,

${requestscope.listA}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号