- 博客(3)
- 收藏
- 关注
原创 @Component类 @Autowired注入为null
@Component类 @Autowired注入为null解决一:解决二:解决一:public class TestBean { public static TestBean testBean; @PostConstruct public void init() { testBean = this; testBean .test= this.test; } //代替@AutoWired取该类 public static TestBean getIn
2022-01-19 21:12:04
716
原创 websocketserver无法使用@Value的处理方式
websocketserver无法使用@Value的处理方式websocketserver中使用yml的配置解决:通过启动类传递参数websocketserver中使用yml的配置因为想在websocketserver中使用yml的配置信息,发现无法直接使用@Value注解,和有@Value的实体类,获取都是null,所以记录一下解决过程,有更好的或者简单的方式欢迎各位老哥留言解决:通过启动类传递参数private static String imgfilepath; @Value("${m
2021-12-08 15:08:43
908
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人