![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot
文章平均质量分 57
韩茜茜
这个作者很懒,什么都没留下…
展开
-
Spring @Autowired非controller中无法注入
前言 在项目中可能会有工具类或者其他类,需要注入Service业务层的类,然而直接注入的话是注入不进去的 解决办法 可以使用如下办法可以解决 @Component public class ArticleInfoUtils { private static MessageService messageService; @Autowired public v...原创 2019-01-12 13:23:34 · 926 阅读 · 1 评论 -
Springboot 本地路径映射localhost路径
前言 由于上传的图片是要前端展示出来的,而磁盘里的图片有不能直接用本地路径直接访问,这时就要把本地的图片路径映射成网页能访问的路径localhost了 解决办法 注意:前面要加file,不然是访问不了的 import org.springframework.context.annotation.Configuration; import org.springframework.web.s...原创 2019-01-12 19:36:36 · 5323 阅读 · 5 评论 -
Springboot 整合ElasticSearch6.2.4遇到的坑 之 new TransportAddress报错
(这个API TransportClient,elastic计划在Elasticsearch 7.0中弃用TransportClient,并在8.0中完全删除它) new TransportAddress()报错,因为这是一个接口 SpringBoot 2.0.6版本对应的是es5.6.12的版本 这是我之前的maven <parent> <gro...原创 2019-02-04 13:52:26 · 7147 阅读 · 1 评论