使用s:iterator标签获取List>,其中Object有List类型

数据封装格式


List<Map<String,Object>> list = new ArrayList<Map<String,Object>> ();
List<Map<String,Object>> sublist= new ArrayList<Map<String,Object>> ();
Map<String,Object> map =new HashMap<String,Object>();
    map.put("day", "2011-09-01");
    map.put("normal", "err");
    map.put("arrList", sublist);

Map<String,Object> map1 =new HashMap<String,Object>();
    map1.put("day", "2011-09-02");
    map1.put("normal", "ok");
    map1.put("arrList", sublist);


标签输出:


<s:iterator value="list" status="i" id="l">
   { "EventID":  ${i.index}, "Date": "${day}"}, // list中Map的Key值
   <s:if test = "normal.equals('err')">   
         <s:iterator value="#l.arrList" status="ii" >
         { "EventID":  ${i.index}, "Date": "${day}", "Title": "异常(${system_name})  ${summi} // arrList中Map的Key值", "URL": "#", "Description": "${day}~${comName}~${sysName }","CssClass":"<s:if test = "stype.equals('inside')">red</s:if> <s:else>orange</s:else> " }     ,  
         </s:iterator>
    </s:if>
<s:else>
         { "EventID":  ${i.index}, "Date": "${day}", "Title": "正常", "URL": "#", "Description": "${day}~${comName}~${sysName }" }     ,               
</s:else>
</s:iterator>  

你可能感兴趣的:(map,s:iterator)