springboot thymeleaf訪問不到靜態資源
spring:
mvc:
# “spring.mvc.static-path-pattern”用於闡述HTTP請求地址,請求非controller地址,如js,css,img等訪問路徑需要加上static,
# 可以不配置也能訪問圖片
# 而“spring.resources.static-locations”則用於描述靜態資源的存放位置。多個路徑(逗號隔開)中依次查找是否存在
static-path-pattern: /static/**
resources:
static-locations: classpath:/static/,file:D:\\
mvc:
static-path-pattern: /static/**
resources:
static-locations: classpath:/static/