ARCHIVES

태그

신고하기

상단 메뉴 페이지

기본 콘텐츠로 건너뛰기

어노테이션 @GetMapping과 @RequestMapping (method = RequestMethod.GET)의 차이점

@GetMapping와 @RequestMapping(method = RequestMethod.GET)의 차이점?

일부 Spring Reactive 예제에서 @GetMapping 대신 @RequestMapping가 사용 된 것을 보았습니다.

---

@GetMapping는 @RequestMapping(method = RequestMethod.GET)의 바로 가기 역할을하는 작성된 주석입니다.

@GetMapping는 새로운 주석입니다. 설정을 해야 합니다.

설정 옵션은 다음과 같습니다.

consumes = "text/plain"
consumes = { "text/plain", "application/*"}

---

즉 @GetMapping 자동 설정이 아니라서 2시간동안 삽질 했다...

댓글