springboot访问静态文件直接通过url

application.yml

加入:

spring:
thymeleaf:
prefix: classpath:/templates/
suffix: .html
mode: HTML
encoding: UTF-8
cache: false
servlet:
content-type: text/html
resources:
static-locations: classpath:/static,classpath:/META-INF/resources,classpath:/templates/
posted @ 2021-04-20 23:54  韦邦杠  阅读(113)  评论(0编辑  收藏  举报