Мне нужно отобразить товар в списке в 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>
Вопрос в том, как мне получить следующий товар в списке?