@RequestMapping(value = "ajax1", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public Map ajax1(HttpServletRequest request, Model model){
return model.asMap();
}
ajax请求报404错误
@RequestMapping(value = "ajax2", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public Map ajax2(HttpServletRequest request, Model model){
return new HashMap<String, Object>();
}
ajax请求正常
翻看源码 发现 model实现linkedhashmap ,而linkedhashmap 继承hashmap
model.asMap与new HashMap有什么区别呢
求大神
http://blog.csdn.net/sunhuwh/article/details/41727257
这些我知道 我是想问 返回map的时候 返回model.saMap与返回new的map 有什么区别 从根上看 都是map 但是结果不一样