WebApplicationContext wac = (WebApplicationContext)config.getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
dealerArticleService = (DealerArticleService) wac.getBean("dealerArticleService");
WebApplicationContext wac = (WebApplicationContext)config.getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
dealerArticleService = (DealerArticleService) wac.getBean("dealerArticleService");
转载于:https://www.cnblogs.com/yanjunwu/p/3693117.html