從velocity 模板切換到thymeleaf 后, 默認模板位置為templates , 有時候靜態資源方在該目錄下會出現訪問404錯誤
解決辦法:
application.properties 中添加:
#dev tools
spring.devtools.livereload.enabled=true
# 靜態文件請求匹配方式
spring.mvc.static-path-pattern=/**
# 修改默認的靜態尋址資源目錄
spring.resources.static-locations = classpath:/templates/,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/