Spring Spring注入Servlet

1.

private Manager manager;
@Override  
    public void init() throws ServletException {  
		super.init();
		ServletContext servletContext=this.getServletContext();
		ctx = WebApplicationContextUtils.getWebApplicationContext(servletContext);
		manager = (Manager) ctx.getBean("manager");
	}

猜你喜欢

转载自xujava.iteye.com/blog/1893499
今日推荐