JSP:
<c:forEach var="cartsInfo" items="${cartList}" varStatus="sts">
<div class="about-top">
<div class="grid images_3_of_1">
<img alt="购物车详细情况" src="showImage?pictureId=${cartsInfo.pictureId}" style="height:185px;width:330px;">
</div>
<div class="grid span_2_of_3">
<h3>${cartsInfo.commodityName}</h3>
<p>品牌:${cartsInfo.brandName}</p>
<p>经销商:${cartsInfo.supplierName}</p>
<p>规格:每${cartsInfo.unit}${goodsForm.specifications}</p>
<p>零售价:${cartsInfo.retailPrice}元</p>
<p>购买日期:${cartsInfo.updateTime}</p>
<p>
${cartsInfo.count}件
<a class="button" href="delCart?cartId=${cartsInfo.cartId}&count=${cartsInfo.count}&commodityId=${cartsInfo.commodityId}"><span>删除</span></a>
</p>
</div>
<div class="clear"></div>
</div>
</c:forEach>
HTML:
<form action="alipayConfirm" th:object="${cartForm}" method="post">
<div th:each="cartsInfo,status:${cartList}">
<div class="about-top">
<div class="grid images_3_of_1">
<img alt="购物车详细情况" th:src="@{showImage(pictureId=${cartsInfo.pictureId})}" style="height:185px;width:330px;"/>
</div>
<div class="grid span_2_of_3">
<h3><span th:text="${cartsInfo.commodityName}"></span></h3>
<p>品牌:<span th:text="${cartsInfo.brandName}"></span></p>
<p>经销商:<span th:text="${cartsInfo.supplierName}"></span></p>
<p>规格:每<span th:text="${#strings.concat(cartsInfo.unit).concat(cartsInfo.specifications)}"></span></p>
<p>零售价:<span th:text="${cartsInfo.retailPrice}"></span>元</p>
<p>购买日期:<span th:text="${cartsInfo.updateTime}"></span></p>
<p>
<span th:text="${cartsInfo.count}"></span>件
<a class="button" th:href="@{delCart(cartId=${cartsInfo.cartId},count=${cartsInfo.count},commodityId=${cartsInfo.commodityId})}"><span>删除</span></a>
</p>
</div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<span th:if="${cartList.size()!=0}"><button class="button"><span>结账</span></button></span>
</form>