J'ai le problème suivant (nouveau à jstl), besoin de créer 4 colonnes de produits dans un e-store, mais je ne sais pas comment itérer manuellement le tableau, a obtenu ce code qui répète le produit pour chaque ligne:jstl List itération manuelle?
<c:forEach items="${productCollection}" var="product">
<tr>
<c:forEach var="i" begin="1" end="4">
<td>
<a href="productDetail.htm"><img width="90" alt="${product.productName}" src="${product.productImage}"/></a>
<a href="productDetail.htm"><c:out value="${product.productName}" /></a>
</td>
</c:forEach>
</tr>
</c:forEach>
J'ai besoin de déplacer manuellement la productLectionection arrayList sur la deuxième boucle. Je voudrais pouvoir faire quelque chose comme le Java Iterator:
<c:forEach items="${productCollection}" var="product">
<tr>
<c:forEach var="i" begin="1" end="4">
<td>
<a href="productDetail.htm"><img width="90" alt="${**Iterator.next().**product.productName}" src="${product.productImage}"/></a>
<a href="productDetail.htm"><c:out value="${**Iterator.next().**product.productName}" /></a>
</td>
</c:forEach>
</tr>
</c:forEach>
Im désolé si c'est une question stupide, toute aide serait appréciée! Merci
vous voulez un produit différent par colonne? que se passe-t-il s'il y a plus de 4 produits? –