spring boot 配置虚拟目录

如上图,关键地方有两个:

1、下方的 web.upload-path (配置本地文件路径)

2、上方一串配置,具体代码如下:

  profiles:
    include: paperIdentify
    active: #spring.profiles.active#
  resources:
    static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}

 以上代码配置在 spring 标签下。 注意标红位置,就是1 所配置的路径

配置好后,若要访问虚拟目录下的文件

直接 http://域名:端口/项目名/文件    即可

猜你喜欢

转载自www.cnblogs.com/remember-forget/p/11274492.html