![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
welingfeng1
这个作者很懒,什么都没留下…
展开
-
记录Spring boot上传图片后不能立即显示的原因及解决方法(读取当前项目下的图片)
原因:因为对服务器的保护措施导致的,服务器不能对外部暴露真实的资源路径,需要配置虚拟路径映射访问。解决方法:1、首先配置好spring boot目录下的application.yml,相关配置如下。(spring boot application.yml读取static文件夹中的css、js、images等的配置)2、建立ImagesUploadConfig类,实现WebMvcConfi...原创 2020-04-07 18:28:00 · 4161 阅读 · 7 评论 -
记录spring学习当中《context:annotation-config》 和 《context:component-scan》的区别
context:annotation-config:注册对以下几个注解的支持。最主要的是前两个@Autowired、@ Resource 、@ PostConstruct、@ PreDestroy、@PersistenceContext、@Requiredcontext:component-scan:扫描@Component指定的类到spring 容器当中。 注意: <context...原创 2020-04-07 16:58:06 · 102 阅读 · 0 评论