引用
<s:bean name= "org.apache.struts2.util.Counter" id= "counter" >
<s:param name="first" value= "0" />
<s:param name="last" value= "10" />
<s:iterator>
counter:<s:property value="current-1" />
</s:iterator>
</s:bean>
其中first属性指定循环起始值,last指定循环终止值,其它相关属性可以查看org.apache.struts2.util.Counter类源码。
在下面迭代器中输入循环的当前值,即:current-1
实际例子
引用
<table class="table">
<tbody>
<tr>
<th>烟叶类型</th>
<th>品种</th>
<th>等级</th>
<th>产地</th>
<th>年度</th>
<th>规格</th>
<th width="40px">标件标志</th>
<th>发运件数</th>
<th>验收件数</th>
<th>差额件数</th>
<th>总重量(KG)</th>
<th>抽包件数</th>
<th width="70px">备注</th>
</tr>
<!-- 循环判断数量 一般7行 -->
<s:bean name="org.apache.struts2.util.Counter" id="counter">
<s:param name="first" value="0" />
<s:param name="last" value="6" />
<s:iterator>
<s:iterator value="%{billData.billDtl}" id='vo' status='st'>
<s:if test="#st.count eq #counter.current">
<tr>
<td>${vo.invName}</td>
<td>${vo.tcBreedName}</td>
<td>${vo.tcGradeName}</td>
<td>${vo.tcLocName}</td>
<td>${vo.tcYear}</td>
<td>${tobacSpecMap[vo.specCd]}</td>
<td>${specFlagMap[vo.specFlg]}</td>
<td>${vo.sendQty}</td>
<td>${vo.realQty}</td>
<td>${vo.realQty - vo.sendQty}</td>
<td>${vo.realWgt}</td>
<td>${vo.checkQty}</td>
<s:if test="#st.count == 1">
<td rowspan="8">${billData.billEntity.remark}</td>
</s:if>
</tr>
</s:if>
</s:iterator>
<s:if test="%{current > billData.billDtl.size}">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<s:if test="current == 1">
<td rowspan="8" > </td>
</s:if>
</tr>
</s:if>
</s:iterator>
</s:bean>
<tr>
<td colspan="7" style="text-align: left;"><label>合计:<label></td>
<td>${billData.billContent['totalSendQty']}</td>
<td>${billData.billContent['totalRealQty']}</td>
<td>${billData.billContent['totalIntQty']}</td>
<td>${billData.billContent['totalWgt']}</td>
<td>${billData.billContent['totalCheckQty']}</td>
</tr>
</tbody>
</table>
分享到:
相关推荐
struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别...
struts2 资料struts2 资料struts2 资料struts2 资料
struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全struts2 总结工程大全...
struts2-core-2.0.1.jar, struts2-core-2.0.11.1.jar, struts2-core-2.0.11.2.jar, struts2-core-2.0.11.jar, struts2-core-2.0.12.jar, struts2-core-2.0.14.jar, struts2-core-2.0.5.jar, struts2-core-2.0.6.jar,...
在struts2中要实现for循环在struts2中要实现for循环
Struts2是一套非常优秀的Java WEB应用框架,实现优雅、功能强大、使用简洁。目前已有大量的企业项目采用Struts2来作为Web框架进行开发,掌握Struts2是每个进行Web开发的Java程序员的一项必备技能。 本视频对Struts2...
struts2源码 struts2案例 struts2使用包
Struts2 Struts2 超好的Struts2 pdf 文档 Struts2 Struts2 超好的Struts2 pdf 文档 Struts2.pdf文档
一个很好的关于Struts2的讲义!struts2讲义struts2讲义struts2讲义struts2讲义struts2讲义struts2讲义
struts2例子struts2例子struts2例子struts2例子struts2例子struts2例子struts2例子struts2例子
struts2的概述struts2下的HelloWord struts2基础 struts2做好准备 struts2的标志 struts2的Action讲解 struts2中的国际化 struts2转化器 struts2实现表单数据校验 struts2的基石-拦截器 struts2中实现IOC struts2中...
struts2环境搭建+struts2 新闻发布系统+struts2 留言板 struts2环境搭建:基础框架搭建,简单易上手,适合新手,比你看书强多了,实践源于理论而高于理论,贵在实践 朋友。 struts2 新闻发布系统:struts2+jsp 功能不...
Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2Struts2...
struts2中循环标签id的设置,找了好久才找到的
-- 为修复struts2 s2-016、s2-017漏洞,重写DefaultActionMapper --> <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="myDefaultActionMapper" class=...
struts2-scan 检测struts2漏洞,认证检测struts2漏洞
《Struts2技术内幕:深入解析Struts2架构设计与实现原理》以Struts2的源代码为依托,通过对Struts2的源代码的全面剖析深入探讨了Struts2的架构设计、实现原理、设计理念与设计哲学,对从宏观上和微观上去了解Struts2...
Struts2漏洞检查工具Struts2.2019.V2.3
struts2官方文档
使用struts2开发之前必须引入struts的包。