Web/Spring

[Spring] @GetMapping @RequestMapping 차이

HYJJ 2021. 12. 20. 22:31

Spring Controller에 있는 RequestMapping을 습관적으로 쓰다가 궁금해서 정리해봤다.

 

@RequestMapping (value="", method= RequestMethod )

 value : 요청받을 URL

 method : 어떤 요청으로 받을지 (GET, POST, PUT, DELETE) 

 

@GetMapping @PostMapping 

: 요청별로 제공되는 어노테이션 ( 어떻게 받을지에 따라 Mapping 앞에 붙음.)