Spring获取配置的beanimport javax.servlet.ServletContextServletContext servletContext actionServl
Spring获取配置的bean
import javax.servlet.ServletContext;ServletContext servletContext = actionServlet.getServletContext();WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);this.petStore = (PetStoreFacade) wac.getBean("petStore"); 