ITeye博客

在Servlet获取spring管理的java对象

sshzhangwg · 2013-05-22 17:00 · Java · Spring · 技术DEMO · Web前端 · Markdown

在Servlet获取spring管理的java对象:

 

private ConfigService getService() {
		if (cfgService == null) {
			WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
			cfgService = (ConfigService) context.getBean("configService");
		}
		return cfgService;
	}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。