spring boot 配置虚拟目录

 

 

 

 

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

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

二、上方一串配置,具体代码以下:sql

 

  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 所配置的路径spa

 

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

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

相关文章
相关标签/搜索