public class SpringBeanUtil implements ApplicationContextAware {
@Autowired
private static ApplicationContext context = null;
private Bean1 bean1;
private Bean2 bean2;
public void setApplicationContext(ApplicationContext context) throws BeansException {
SpringBeanUtil.context = context;
// bean1 = context.getBean(Bean1.
spring bean 动态创建、核心类ApplicationContext 、AutowireCapableBeanFactory
最新推荐文章于 2024-05-08 17:03:13 发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)