在yml里添加spring.mvc和resource

spring:
  mvc:
    static-path-pattern: /**
  resources:
    static-locations: classpath:/META-INF/resources/,classpath:/resources/, classpath:/static/, classpath:/public/, file:D:/head

因为我的文件是放在D:/head 下面(file后面接你的路径);
message:
spring boot访问根盘下的文件:
根盘目录:
spring boot访问根盘下的文件:
数据库存放数据:
spring boot访问根盘下的文件:
nice,终于成功了,记录下。

相关文章:

  • 2021-11-16
  • 2021-12-16
  • 2022-12-23
  • 2021-05-03
  • 2021-07-06
  • 2021-11-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2021-10-05
相关资源
相似解决方案