14
使用Ajax将@RequestBody中的多个变量传递给Spring MVC控制器
是否需要包装支持对象?我想做这个: @RequestMapping(value = "/Test", method = RequestMethod.POST) @ResponseBody public boolean getTest(@RequestBody String str1, @RequestBody String str2) {} 并使用这样的JSON: { "str1": "test one", "str2": "two test" } 但是我必须使用: @RequestMapping(value = "/Test", method = RequestMethod.POST) @ResponseBody public boolean getTest(@RequestBody Holder holder) {} 然后使用以下JSON: { "holder": { "str1": "test one", "str2": "two test" …
113
java
spring
http
spring-mvc