2018年9月14日

spring 打印所有创建的beans

摘要: 1,创建一个类,实现接口 BeanPostProcessor 阅读全文

posted @ 2018-09-14 21:28 缘在此季 阅读(524) 评论(0) 推荐(0) 编辑

ApplicationContext之getBean方法详解

摘要: 我们知道可以通过ApplicationContext的getBean方法来获取Spring容器中已初始化的bean。getBean一共有以下四种方法原型:l getBean(String name)l getBean(Class<T> type)l getBean(String name,Class 阅读全文

posted @ 2018-09-14 20:52 缘在此季 阅读(1359) 评论(0) 推荐(0) 编辑

多线程时Autowired自动注入问题

摘要: 在多线程时使用@Autowired总是获取不到bean,原因是:new thread不在spring容器中,也就无法获得spring中的bean对象。 解决方法:手动获取 在其他service里调用 阅读全文

posted @ 2018-09-14 20:06 缘在此季 阅读(1462) 评论(0) 推荐(0) 编辑

导航