RequestParam

controller에서 Map은 파라미터로 쓸수 있고 모델로도 쓸 수 있다. 그냥 쓰면 모델로 사용한다는 것이고 파라미터로 사용할 때는 @RequestParam과 같이 사용하여야 한다. @PostMapping("/api/foos") @ResponseBody public String updateFoos(@RequestParam Map allParams) { return "Parameters are " + allParams.entrySet(); } @RequestParam을 선택적으로 사용할 수도 있다. @GetMapping("/api/foos") @ResponseBody public String getFoos(@RequestParam(required = false) String id) { return "I..
Sungwoo Koo
'RequestParam' 태그의 글 목록