springboot + thymeleaf 打成jar包後無法訪問靜態文件

POM文件添加nekohtml

<dependency>
    <groupId>net.sourceforge.nekohtml</groupId>
    <artifactId>nekohtml</artifactId>
</dependency>

application.properties添加thymeleaf指定靜態文件目錄位置

spring.thymeleaf.prefix=classpath:/templates
spring.thymeleaf.mode=LEGACYHTML5
spring.thymeleaf.suffix=.html
spring.thymeleaf.encoding=utf-8
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章