Struts(logic:iterate标签) 迭代 Map(HashMap)集合

Struts(logic:iterate标签) 迭代 Map(HashMap)集合: 
(1) 
Map map=new map(); 
map.put("a",""a");

<logic:iterate iterateid="id"name="map"> 
<bean:write name="id"property="key"/> 
<bean:write name="id"property="value"/> 
</logic:iterate>

(2) 
Map map=new map(); 
map.put("a",放一个对象); 
<logic:iterate iterateid="id"name="map"> 
<bean:write name="id"property="key"/> 
<bean:write name="id"property="value.属性名"/> 
</logic:iterate>

(3) 
Map map=new map(); 
map.put("a",String[]数组); 
<logic:iterate id="m" name="map"> 
<bean:write name="m" property="key"/><BR> 
<logic:iterate id="val" name="m" property="value"> 
<bean:write name="val"/> 
</logic:iterate>    
</logic:iterate>

(4)

Map map=new map(); 
map.put("a",List集合对象); 
<logic:iterateid="user"name="map"> 
<bean:write name="user" property="key"/> 
<logic:iterate name="user" property="value> 
<bean:write name="value.属性名"/> 
</logic:iterate>    
</logic:iterate>

你可能感兴趣的:(java,struts)