ControllerAdvice1 [Spring] @(Rest)ControllerAdvice 활용 0. 이 글을 쓰게된 이유 미션을 진행하며 (Rest)ControllerAdvice를 사용하여 예외를 처리하였다. 원래 (Rest)ControllerAdvice가 예외를 처리할 때에만 사용하는줄 알았는데 활용할 수 있는 부분이 많은 기능이었다. 그 부분에 대해 알아보기 위해 이 글을 쓰게 되었다. 1. @(Rest)ControllerAdvice란? Spring 공식 문서에 따르면 @(Rest)ControllerAdvice가 붙은 빈은 모든 @Controller이 붙은 빈에서 사용하는 @ExceptionHandler, @InitBinder, @ModelAttribute(글 쓰기 쉽게 세가지 기능이라고 부르겠다.)가 붙은 메소드들을 한번에 처리할 수 있도록 해주는 기능이다. Controller에서 @Exce.. 2023. 4. 13. 이전 1 다음