hanker

Spring - Thymeleaf 경로 설정 (templates) 본문

SPRING

Spring - Thymeleaf 경로 설정 (templates)

hanker 2021. 4. 27. 11:06

application.properties

spring.thymeleaf.prefix=classpath:templates/
spring.thymeleaf.suffix=.html

 

작성 후 

/resources/templates/* 파일을 바라보기 시작한다.

 

Controller에서 코드를 작성 후 실행을 하면 /resources/templates/index.html 을 확인할 수 있다.

 

 

단, Spring boot로 프로젝트는 자동으로 resources/template 을 바라보지만

컨트롤러에서 Mapping URL을 지정해주지 않으면 resources/static 경로에있는 정적파일을 찾게 된다.