intellij +springboot/오류정리
template might not exist or might not be accessible by any of the configured Template Resolvers
jeongyj
2022. 10. 5. 17:26
화면 템플릿을 찾지 못했다 는 에러 템플릿 이름을 잘 살펴보거나 경로를 맞춰줘야 한다 나같은 경우에는
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exce
ption [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template [/fragment/header], template might not exist or might no
t be accessible by any of the configured Template Resolvers (template: "login" - line 4, col 7)] with root cause
로컬에서 실행시켰을떈 문제 없었는데 jar 로 빌드해서 실행시키니까 th:replace= 로 나눠논 화면을 찾지 못했다..
기본 설정이 있는지 모르겠지만
<head th:replace="/fragment/header :: mainHead"></head>
에서
<head th:replace="fragment/header :: mainHead"></head>
슬래시 지워주니까 잘 됐다