<c:set var="count" value="${0}"/> //声明变量count,并赋初始值0
<c:forEach items="${requestScope.list }" var="order" varStatus="varStatus">
<tr align="center">
<td>${order.partnerid}</td>
<td>${order.subcid}</td>
<td>${order.counter}</td>
<c:set var="count" value="${count+order.counter}"/>//让count累加counter,把循环里面的counter数值全部累加起来
</tr>
</c:forEach>
<tr align="center">
<td colspan="2"><b>合计</b></td>
<td><b>${count}</b></td>//再到另外一行打印出来
</tr>
jstl里面给EL表达式赋值
最新推荐文章于 2021-09-27 15:20:08 发布