struts2显示MAP数据
struts2显示MAP数据
<table border=1 width=500px>
<tr><th>商品号</th><th>销售数量(单位:件)</th><th>销售日期</th></tr>
<s:iterator value="#request.map_statistics.keySet()" id="business"> //map健值
<tr style="text-align:center;">
<td><s:property value="%{#business}"/></td>
//健对应的值,JAVABEAN对象
<s:iterator value="#request.map_statistics.get(#business)" id="stocks">
<s:property value="%{#stocks.count}"/></td>
<td><s:property value="%{#stocks.date}"/></td>
</s:iterator>
</tr>
</s:iterator>
</table>
<table border=1 width=500px>
<tr>
<th>商品号</th>
<th>总进货</th>
<th>总出货</th>
<th>剩余量(单位:件)</th>
</tr>
<s:iterator value="#request.map.keySet()" id="maptype">
<tr style="text-align:center;">
<td>
<s:property value="%{#maptype}"/> //map健值
</td>
<s:iterator value="#request.map.get(#maptype)" id="stocks"> //存放了数组
<td><s:property value="%{#stocks}"/></td>
</s:iterator>
</tr>
</s:iterator>
</table>