Spring MVC - Why not able to use @RequestBody and @RequestParam together
问题 Using HTTP dev client with Post request and Content-Type application/x-www-form-urlencoded 1) Only @RequestBody Request - localhost:8080/SpringMVC/welcome In Body - name=abc Code- @RequestMapping(method = RequestMethod.POST) public String printWelcome(@RequestBody String body, Model model) { model.addAttribute(\"message\", body); return \"hello\"; } // Gives body as \'name=abc\' as expected 2) Only @RequestParam Request - localhost:8080/SpringMVC/welcome In Body - name=abc Code-