Error Page 처리
BasicErrorController 의 처리 뷰 선택 우선순위
Spring 지원 기본 error template => /error/~
-> Override 해서 경로 수정 후 사용 가능.
-
뷰템플릿
- resources/templates/error/500.html
- resources/templates/error/5xx.html
-
정적리소스(static,public)
- resources/static/error/400.html
- resources/static/error/404.html
- resources/static/error/4xx.html
-
적용 대상이 없을 때 뷰 이름(error)
- resources/templates/error.html
API 에러처리
에러처리를 따로 해주지 않는다면 만약 json Rest API통신을 할 때 에러가 발생할 경우 에러 페이지를 리턴한다.
하지만 JSON통신에서는 페이지의 html을 해석할 수 없기 때문에 이를 처리해줘야한다.