map集合的循环示例
/** * 报警状态下拉列表信息 * @return * @throws Exception */ public String alarmStatusList() throws Exception { List<Map<String, String>> list = new ArrayList<Map<String,String>>(); Map<String, String> map1 = new HashMap<String, String>(); Map<String, String> map2 = new HashMap<String, String>(); map2.put("value", ""); map2.put("text", "全部"); list.add(map2); map1 = dicItemManager.findItemMapByGroupCode("jdclx"); for (String key : map1.keySet()) { map2 = new HashMap<String, String>(); map2.put("value", map1.get(key)); map2.put("text", map1.get(key)); list.add(map2); } JSONArray arry = JSONArray.fromObject(list); this.jsonObject = arry.toString(); return JSON; }