首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

Struts2 <s:iterator> 遍历 List<Map<String, String>>

2012-06-28 
Struts2 s:iterator 遍历 ListMapString, Strings:iterator value#request.list idmap statu

Struts2 <s:iterator> 遍历 List<Map<String, String>>

<s:iterator value="#request.list" id="map" status="stat">
???<tr>
?????? <td align="center">
?????&nbsp;<s:property? value="#stat.count" /></td>
????<td align="center">
?????&nbsp;${map.drug_no }</td>
????<td align="center">
?????&nbsp;${map.drug_name }</td>
????<td align="center">
?????&nbsp;${map.stock_pack_type }</td>
????<td align="center">
?????&nbsp;${map.stock_pack_unit }</td>
????<td align="center">
?????&nbsp;${map.drug_batch_no }</td>
????<td align="center">
?????&nbsp;${map.num }</td>
????<td align="center">
?????&nbsp;${map.retail_price }</td>
????<td align="center">
?????&nbsp;${map.vendor }</td>
????<td align="center">
?????&nbsp;${map.validity_date }</td>
????<td align="center">
??????????????????? &nbsp;<img src="<%=imgPath %>/add/editt.gif" onMouseOver="this.style.cursor='hand'"
???????border="0" onClick="edit('${map.row_id }')" /></td>
????<td align="center">
?????&nbsp;<img? src="<%=imgPath %>/add/delete.gif" onMouseOver="this.style.cursor='hand'"
??????????? border="0" onClick="del('${map.row_id }')">&nbsp;</td>
???</tr>
??</s:iterator>

?

说明:<s:iterator value="#request.list" id="map" status="stat">
#request.list: 后台request.setAttribute("list", list); 保存值

map:? list中保存的是Map

stat:? 获取遍历索引

?

${map.retail_price }:通过EL表达式获取Map中的值

热点排行