Spring-boot thymeleaf load HTML file from classpath

后端 未结 1 835
青春惊慌失措
青春惊慌失措 2020-12-09 17:39

I\'ve a multi module project structure like :

- application (parent module)
--- boot (web-app)
----- src/main/resources/templates/layout.html

---- todo (ja         


        
相关标签:
1条回答
  • 2020-12-09 18:14

    Adding following properties solves my problem:

    spring.thymeleaf.check-template-location=true
    spring.thymeleaf.prefix=classpath:/templates/
    spring.thymeleaf.suffix=.html
    spring.thymeleaf.mode=LEGACYHTML5
    spring.thymeleaf.encoding=UTF-8
    spring.thymeleaf.content-type=text/html
    spring.thymeleaf.cache=false
    
    0 讨论(0)
提交回复
热议问题