后台:得到Map<String,List<Object>> map ;
通过JSONArray.fromObject(map);放到json 对象中再通过response.getWriter().print(json);发送到前台在前台怎么读取呢?我前台用的是jqery ajax
$.ajax({
url: '<%=path%>/zbgl/aclUserAction.do?doaction=getQxList',
type: 'post',
dataType: 'json',
contentType:'application/x-www-form-urlencoded; charset=utf-8',
success: function(data){
alert(data[0].roles_0);
//就是这里不知道怎么遍历json中的map对象
}
});
通过JSONArray.fromObject(map);放到json 对象中再通过response.getWriter().print(json);发送到前台在前台怎么读取呢?我前台用的是jqery ajax
$.ajax({
url: '<%=path%>/zbgl/aclUserAction.do?doaction=getQxList',
type: 'post',
dataType: 'json',
contentType:'application/x-www-form-urlencoded; charset=utf-8',
success: function(data){
alert(data[0].roles_0);
//就是这里不知道怎么遍历json中的map对象
}
});
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货