【发布时间】:2011-05-04 14:03:40
【问题描述】:
我需要将列表中的产品显示为带有foreach 的 3 列。
这是我的代码:
<table>
<c:forEach items="${lstProduct}" var="product" varStatus="status" step="3">
<tr>
<td>
<!--product of column left will be display here -->
${product.id}
${product.name}
</td>
<td>
<!--product of column middle will be display here -->
<!--I need something like this: productMiddle = product.getNext() -->
</td>
<td>
<!--product of column right will be display here -->
<!-- productRight = productMiddle.getNext() -->
</td>
</tr>
</c:forEach>
</table>
问题是如何获得列表中的下一个产品?
【问题讨论】: