在jsp中拿到applicationContext

WebApplicationContext wac = (WebApplicationContext)config.getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
 StationService stationService = (StationService)wac.getBean("stationService");
 LinkService linkService = (LinkService)wac.getBean("linkService");

posted @ 2013-12-03 18:36  NewObject_1  阅读(755)  评论(0编辑  收藏  举报