struts2 Action得到spirng ApplicationContext
ApplicationContext ac = WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext()); DataSource ds = (DataSource) ac.getBean("dataSource");
发布时间: 2013-08-04 18:26:16 作者: rapoo
struts2 Action得到spirng ApplicationContext
ApplicationContext ac = WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext()); DataSource ds = (DataSource) ac.getBean("dataSource");