jQueryeasyUI的JSON传值到datagrid

后台我封装好json并发送
public String search(){
Map map = new HashMap();
map.put("nodeIcon", "1");
map.put("parentID","2");
map.put("nodeID","3");
map.put("isLeaf","4");
map.put("nodeText","5");
map.put("nodeAction","6");
String json = CastJson.toJson(map);
System.out.println(json);
try {
ServletActionContext.getResponse().getWriter().println(map);
} catch (IOException e) {
e.printStackTrace();
}

return SUCCESS;
}
请问在前台如何在editable datagrid接收后台传的json呢?Demo例子中是一个url指向一个json文件,谢谢。QQ25262875

ServletActionContext.getResponse().getWriter().println([color=red]map[/color]);
这里应该是转换后的json字符串:
ServletActionContext.getResponse().getWriter().println(json);

然后前边js还是把datagrid的url指向你的这个jsp或者servlet

建议使用Jackson,Jackson提供了最好的性能,转换Java对象可以是List,POJO[],POJO,也可以Map名值对。
[code="java"]
org.codehaus.jackson.map.ObjectMapper mapper = new org.codehaus.jackson.map.ObjectMapper();
response.setCharacterEncoding("utf-8");
mapper.writeValue(response.getWriter(), map);
[/code]