springboot thymeleaf访问不到静态资源


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/


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM