Springboot解决静态资源过滤终于解决了!!! #图片上传后通过ip 端口访问静态文件

时间:2021-04-01 13:16:56   收藏:0   阅读:0

首先感谢这位大哥帖子:https://www.hangge.com/blog/cache/detail_2461.html 

 

 

技术图片

 

 

解决如下:

在application.properties加:

spring.web.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,\
classpath:/static/,classpath:/public/ --追加你的过滤目录--

 

扩展:

1)classpath路径:

String classpath = ResourceUtils.getURL("classpath:").getPath();

2)

技术图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!