首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Spring获取配备的bean

2012-10-09 
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");

热点排行