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
posted @ 2020-03-25 15:18  ZMemory  阅读(753)  评论(0编辑  收藏  举报