Spring在Web环境中把系统初始化的时候创建的bean池放在了ServletContext中,你可以从中获取。WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
XxxBean bean = webContext.getBean("XxxBeanName");
XxxBean bean = webContext.getBean("XxxBeanName");
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货