一、方法中可以出现的参数类
1.HttpServletRequest
2.HttpServletResponse
3.HttpSession
4.Model
二、返回接收json数据
1. 接收,返回JSON数据
@RequestMapping(value = "/loginPro",method = RequestMethod.POST) @ResponseBody public Object loginPro(@RequestBody User user, HttpSession session){ Map<String,String> rs = new HashMap<String ,String>(); User u = userService.login(user); rs.put("Status","ok"); return rs; }
依赖jar包:
2.表单提交
JSON.stringify($('#loginForm').serializeJSON()
依赖文件:jquery.serializejson.js