spring在代码中获取bean

 spring在tomcat启动后获取bean

WebApplicationContext wac = ContextLoader.getCurrentWebApplicationContext();
wac.getBean(beanName);

参考链接:

https://www.jb51.net/article/96371.htm

https://blog.csdn.net/yalishadaa/article/details/73124387

猜你喜欢

转载自blog.csdn.net/u010999809/article/details/81071675