相关疑难解决方法(0)

JSTL foreach:获取Next对象

我需要将列表中的显示产品分成3列foreach.

这是我的代码:

<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>
Run Code Online (Sandbox Code Playgroud)

问题是如何在列表中获得下一个产品?

jsp jstl

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

jsp ×1

jstl ×1