template might not exist or might not be accessible by any of the configured Template Resolvers
라는 에러 발생.
기본적으로 스프링 부트는 템플릿엔진의 경로를 spring.thymeleaf.prefix=classpath:/templates/
라고 잡기 때문에,
<th:block th:replace="~{/fragment/layout::setContent(~{this::content})}">
이런식으로 설정해두면 - 슬래쉬가 두번 들어가서 경로를 못찾았던 것이다. 즉 이러한 경우 url경로는 templates//fragment/layout~~ 이 된다. 인텔리제이는 똑똑해서 이러한 에러를 잡아주었지만, 빌드후 배포해보니 여기서 계속 에러가 나서 페이지를 불러오지 못하는 에러가 있었다.따라서 스프링이 기본적으로 auto-config해놓은 타임리프 기본경로의 classpath를 위와 같이 수정. 슬래쉬만 뺐다.
잘 돌아간다!!!

댓글 없음:
댓글 쓰기