반응형 ControllerAdvice1 SpringBoot RestAPI 404 Not Found message Custom, @ControllerAdvice @ExceptionHandler SpringBoot 로 API를 개발할 때 RequestMapping 되어있지 않은 주소로 요청하면 아래와 같은 에러 메시지를 전송합니다. { "timestamp": "2022-11-09T09:35:14.441+00:00", "status": 404, "error": "Not Found", "message": "No message available", "path": "/api/" } 기존에 API 에서 전송하던 구조와 다르면 제공받는 입장에서도 처리하기 껄끄럽기 때문에 기존 응답 구조에 맞게 설정을 해주는 것이 좋습니다. 그럼 응답 구조에 맞게 처리하는 방법을 알아보겠습니다. 우선 application.yml 파일에 설정을 추가해 주어야 합니다. 1. spring boot properties 설정 [ap.. Programing/Springboot 2022. 11. 9. 이전 1 다음 💲 추천 글 반응형