@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有什么区别呢
求大神