求助:JSTL中的<c:foreach>遍历怎么才能算出总销售-本金=总利润
<c:set var="sum" value="0"/>
<c:forEach items = "${shopList}" var = "shop">
<tr>
<td>${shop.shopID}元</td>
<td>${shop.shopName}元</td>
<td>${shop.costPrice}元</td>
<td>${shop.flatPrice}元</td>
<td>${shop.flatPrice - shop.costPrice}元<c:set var="sum" value="${sum+shop.flatPrice - shop.costPrice}"/></td>
</tr>
</c:forEach>
<tr>
<td colspan="4" align="center">总利润</td>
<td>
${sum}
</td>
</tr>