ViewResolver 경로 변경 설정(cannot resolve mvc view 'index')

토니·2023년 1월 13일

에러-해결

목록 보기
3/3

기본 적인 것인데 404 error가 뜨면서 cannot resolve mvc view 'index' 라는 문구가 떴었다.

뷰리졸버가 index를 인식 못하는 것인데 경로 문제라고 생각하여 구글링 하였다.

스프링부트의 ViewResolver 디폴트 경로는

src/main/resources/templates를 탐색

templates가 아닌 다른 곳에 정적 리소스를 저장 할 시

spring.thymeleaf.prefix=classpath:/저장소 이름/

이렇게 application.properties 혹은 yml에 설정을 해줘야한다.

profile
길을 찾고 있는 방랑자

0개의 댓글