是否需要包裝支持對象?我想做這個:@RequestMapping(value = "/Test", method = RequestMethod.POST)@ResponseBodypublic boolean getTest(@RequestBody String str1, @RequestBody String str2) {}并使用這樣的JSON:{ "str1": "test one", "str2": "two test"}但是我必須使用:@RequestMapping(value = "/Test", method = RequestMethod.POST)@ResponseBodypublic boolean getTest(@RequestBody Holder holder) {}然后使用以下JSON:{ "holder": { "str1": "test one", "str2": "two test" }}那是對的嗎?我的另一個選擇是將更RequestMethod改為GET并@RequestParam在查詢字符串中使用或@PathVariable與一起使用RequestMethod。
添加回答
舉報
0/150
提交
取消