日期:2014-05-16  浏览次数:20364 次

jstl里面给EL表达式赋值

<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>