JSTL中怎么遍历获取MAP 的键 和值
List<Record>rolelist = RoleModel.roleDao.getRolelist();
List<Map<String, String>>rolesMap = new ArrayList<Map<String, String>>();
for(Record role : rolelist){
Map<String, String> map=new HashMap<String,String>();
map.put(role.getStr("r_name"), ","+role.getStr("role_id")+",");
rolesMap.add(map);
}
System.out.println(rolesMap.size());
setAttr("maplist", rolesMap);
setAttr("flowstep", flowstep);
前台遍历取不到(entry.key和entry.value取不到要怎么取啊)
<c:forEach items="${maplist}" var="entry">
<span>
<input type="checkbox" name="role_id" value="${entry.value}" class="rids"/>
<span>${entry.key}</span>
</span>
</c:forEach>
翻阅古今
相关分类