Sptring
  • 사용된 어노테이션 SpringBoot 프레임워크에서 Exception 처리를 공통처리를 해보자. 그전에, 알아야할 어노테이션을 정리해보자. 어노테이션 설명 @RestController @Controller + @ResponseBody 이다. Json, Xml 등의 format으로 return 해줄 경우에 사용한다. @RestControllerAdvice 기본은 @ControllerAdvice 어노테이션이 존재하는데, Json, Xml Format으로 return 해줄 경우 대신 사용한다. 웹 어플리케이션 전역에서 Exception 발생시, 해당 에러를 잡아 처리한다. @ExceptionHandler 발생한 Exception 에 따라 선택적으로 특정 메소드를 실행한다. Exception 파일 BadRequ..

    Read more
  • Copyright 2024. GRAVITY all rights reserved