• Spring boot + Thymeleaf + IntelliJ
  • 개발 툴에서 실행시 정상 작동하나 jar로 실행시 index 페이지만 진입되고 다른 페이지는 뷰단을 못찾음
  • application.yml에는 Thymeleaf 설정하지 않음
  • view path: /member/custom-login

template might not exist or might not be accessible by any of the configured Template Resolvers

18:46:38.954 [http-nio-8080-exec-10] ERROR org.thymeleaf.TemplateEngine - [THYMELEAF][http-nio-8080-exec-10] Exception processing template "/member/custom-login": Error resolving template [/member/custom-login], template might not e
xist or might not be accessible by any of the configured Template Resolvers
org.thymeleaf.exceptions.TemplateInputException: Error resolving template [/member/custom-login], template might not exist or might not be accessible by any of the configured Template Resolvers
        at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:869) ~[thymeleaf-3.0.15.RELEASE.jar!/:3.0.15.RELEASE]
        at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:607) ~[thymeleaf-3.0.15.RELEASE.jar!/:3.0.15.RELEASE]

 

 

spring:
  thymeleaf:
    prefix: classpath:/templates/

 

spring.thymeleaf:prefix: classpath:/templates/ 옵션을 추가하였으나 효과가 없었음 

경로에 슬래시(/)가 중복으로 들어가면 에러가 발생 한다고 한다.

리턴 패스를 "/member/custom-login"에서 "member/custom-login"로 변경하자 정상 작동하였다.

 

spring.thymeleaf:prefix: classpath:/templates <- 여기서 슬래시를 지워도 작동 되지만

해당 옵션 디폴트 값이 classpath:/templates/라서 패스에서 슬래시를 빼는 쪽으로 가기로 했다.

 

 

 

## 참고글

 

https://bigphu.tistory.com/94

 

[Spring Boot/Thymeleaf] Exception processing template

스프링 부트로 프로젝트 작업중에 파싱에러가 발생했다. ide 사용시에는 정상이었으나 운영배포 때문에 jar package 테스트를 위하여 cmd 창에서 java -jar 로 실행하니 에러가 발생하였다. 총 두가지

bigphu.tistory.com

https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html#application-properties.templating.spring.thymeleaf.enabled

 

Common Application Properties

 

docs.spring.io

 

+ Recent posts