- 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>
Struts(logic:iterate标签) 迭代 Map(HashMap)集合:
最新推荐文章于 2013-08-05 09:09:50 发布