在application.properties的配置文件中加入:

1 spring.resources.static-locations=classpath:/externalFil    //可访问此文件夹下的所有内容(内部文件夹地址)
2 或:
3 spring.resources.static-locations=file:D://externalFil     //外部文件夹地址

就可以通过 localhost:端口号/文件名 访问该文件夹下的文件了。

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2021-12-11
  • 2021-04-22
  • 2022-12-23
  • 2021-06-10
  • 2021-11-02
  • 2022-12-23
猜你喜欢
  • 2021-05-07
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
  • 2021-11-25
相关资源
相似解决方案