import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; //struts2 获取ServletContext ServletActionContext.getServletContext(); ServletContext application = getServletContext(); WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(application); XyManager flightTicketManager = (XyManager) wac.getBean("xyManager ");
servlet中获取spring context, 获取bean
猜你喜欢
转载自jerryzxm.iteye.com/blog/1766974
今日推荐
周排行