level 1
DIVINEXIAO
楼主
具体数据如下
后台控制器代码
@RequestMapping("/test")
public String test(HttpServletRequest req,HttpServletResponse response){
//查询人次
Map<String, Object> mapone= new HashMap<String, Object>();
Map<String, Integer> map2=new HashMap<String, Integer>();
map2.put("zs",10);
map2.put("ls",20);
Map<String, Integer> map3=new HashMap<String, Integer>();
map3.put("ww",30);
map3.put("zl",40);
mapone.put("one",map2);
mapone.put("two",map3);
req.setAttribute("mapone", mapone);
return "/test";
}
前台js进行遍历map。但是在页面上我是用
var mapone='${mapone}';
进行取值,这个时候数据类型变成了String(我是通过typeOf(mapone)看到了)。这个时候我该怎么遍历。求大神解答
2017年06月28日 10点06分
1
后台控制器代码
@RequestMapping("/test")
public String test(HttpServletRequest req,HttpServletResponse response){
//查询人次
Map<String, Object> mapone= new HashMap<String, Object>();
Map<String, Integer> map2=new HashMap<String, Integer>();
map2.put("zs",10);
map2.put("ls",20);
Map<String, Integer> map3=new HashMap<String, Integer>();
map3.put("ww",30);
map3.put("zl",40);
mapone.put("one",map2);
mapone.put("two",map3);
req.setAttribute("mapone", mapone);
return "/test";
}
前台js进行遍历map。但是在页面上我是用
var mapone='${mapone}';
进行取值,这个时候数据类型变成了String(我是通过typeOf(mapone)看到了)。这个时候我该怎么遍历。求大神解答