jsp中获取spring 管理的bean(通过config)

WebApplicationContext wac = (WebApplicationContext)config.getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

dealerArticleService = (DealerArticleService) wac.getBean("dealerArticleService");

 

posted @ 2014-04-26 23:36  NewObject_1  阅读(290)  评论(0编辑  收藏  举报