document.write("");

springboot 静态文件夹

正常这个很久了,不需要写,但是好几年没有写这个相关的,都忘了,好记性不如烂笔头

 

spring:
  resources:
    static-locations: file:D:\\test       #对应服务器内映射的实际路径
  mvc:
    static-path-pattern: /test/**         #对应服务通过url访问静态文件夹时的前缀
  servlet:
    multipart:
      enabled: true
      max-file-size: 100MB
      max-request-size: 100MB
server:
  port: 80

如:访问http://localhost/test/xx.txt

会获取D盘test文件夹下的xx.txt文件

posted @ 2023-04-21 08:52  人间春风意  阅读(42)  评论(0编辑  收藏  举报