读书人

Spring获取配备的bean

发布时间: 2012-10-09 10:21:45 作者: rapoo

Spring获取配置的bean

import javax.servlet.ServletContext;ServletContext servletContext = actionServlet.getServletContext();WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);this.petStore = (PetStoreFacade) wac.getBean("petStore");

读书人网 >软件架构设计

热点推荐