赞
踩
默认配置
spring:
profiles:
active: druid,mybatis,security,redis
mvc:
static-path-pattern: /**
resources:
static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/
获取本地资源,在默认配置后加上你所要获取的资源的路径。
假使我要获取的图片路径为D://upload/img/1.jpg,那么在默认路径后添加file:D://upload/img/,然后运行项目,这时访问该图片的路径为localhost:8080/1.jpg,如果添加的路径为:file:D://upload/,那么该图片访问路径为localhost:8080/img/1.jpg。
spring:
profiles:
active: druid,mybatis,security,redis
mvc:
static-path-pattern: /**
resources:
static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file: D://xxx/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。