struts2知识点汇总
2024-08-25 14:01:43
标签遍历Map<key,List<Object>>
listMap=new HashMap<String,List<Student>>(); List<Student> list1=new ArrayList<Student>();
list1.add(new Student(new Long(1),"20034140201","张三1","男",25));
list1.add(new Student(new Long(2),"20034140202","张三2","男",25));
list1.add(new Student(new Long(3),"20034140203","张三3","男",25));
listMap.put("class1", list1); List<Student> list2=new ArrayList<Student>();
list2.add(new Student(new Long(1),"20034140301","李四1","男",20));
list2.add(new Student(new Long(2),"20034140302","李四2","男",21));
list2.add(new Student(new Long(3),"20034140303","李四3","男",22));
list2.add(new Student(new Long(4),"20034140304","李四4","男",23));
listMap.put("class2", list2);
<s:iterator value="listMap" id="column">
<s:set name="total" value="#column.value.size"/>
<s:iterator value="#column.value" status="s">
<tr>
<s:if test="#s.first"><td rowspan="${total}"><s:property value="#column.key"/></td></s:if>
<td><s:property value="id"/></td>
<td><s:property value="num"/></td>
<td><s:property value="name"/></td>
<td><s:property value="sex"/></td>
<td><s:property value="age"/></td>
</tr>
</s:iterator>
</s:iterator>
标签遍历List<Map<key,Object>>
<s:iterator value="recipientInfoList" var="recipientInfo">
<tr>
<s:iterator value="recipientInfo" id="ri" status="map">
<s:iterator value="#ri.value">
<td width="25px">
<s:property value="cjf"/>
</td>
<td width="25px">
<s:property value="unit"/>
</td>
</s:iterator>
</s:iterator>
</tr>
</s:iterator>
struts2配置文件,重定向action并传真
<action name="updateCampaign" class="campaignAction" method="updateCampaign">
<result name="success" type="redirectAction">
<param name="actionName">viewCampaignDetail</param>
<param name="campaignId">${campaignId}</param>
</result>
</action>
struts接收数组
publicclass A { private String param[]; public String[] getParam() { returnparam; } publicvoid setParam(String[] param) { this.param = param; } publicvoid execute(){ for(int i=0;i<this.param.length;i++){ System.out.println(this.param[i]); } } }
参考链接
http://blog.csdn.net/hakunamatata2008/article/details/5295500
http://blog.csdn.net/shen516/article/details/10111677
最新文章
- DDD中的Unitwork与DomainEvent如何相容?(续)
- [Sass]声明变量
- Spring和EJB3的技术对比
- 用canvas开发H5游戏小记
- 如何自己编写一个easyui插件
- [译]git clone
- [转载]Linux命令笔记
- respond.js
- 转义字符_MySQL识别下面的转义序列
- Ecological Premium
- Unity 区分不同平台
- MvvmLight 绑定
- ios开发--苹果企业开发者账号
- phpcms V9实现QQ登陆OAuth2.0
- 几种连接数据库的OLEDB驱动程序
- Spring的IOC
- HTML之学习笔记(八)表格
- android的fragments管理
- hdu_5862_Counting Intersections(扫描线)
- image图片拉伸