spring获取当前已启动容器

WebApplicationContext context = ContextLoader.getCurrentWebApplicationContext();
IService service = (IService) context.getBean("service");
 

猜你喜欢

转载自linjia880714.iteye.com/blog/1061529