由于业务需求,要在一个foreach里面实现一次遍历两个链表:后台传来的是连个list: 分别是
<c:set var = "i" value = "0"/> <c:forEach items="${requestScope.sppurchases}" var="spp" varStatus="stat"> <tr class="cart_item"> <td class="product-price"><span class="amount">${spp.dingdanid}</span></td> <td class="product-name"><a href="${pwd }/goods/detial?id=${spp.gid}">${requestScope.name[i]}</a></td> <td class="product-price"><span class="amount">${spp.num}</span></td> <td class="product-price"><span class="amount">${spp.money}</span></td> <td class="product-price"><span class="amount">${spp.purtime}</span></td> </tr> <c:set var = "i" value = "${i + 1}"/> </c:forEach>