servlet直接调用spring的serivce方法

ServletContext sc = this.getServletContext();

		WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(sc);

		this.serviceFacade = (XlycServiceFacade) wac.getBean("XlycServiceFacade");

		t = new Timer();

		TimerCancelorder tco = new TimerCancelorder();

		tco.setServiceFacade(this.serviceFacade);

		t.schedule(tco, 0,60*60*1000);
成长的乐趣,在于分享!
大龄程序员,一路走来,感慨颇多。闲暇时写写字,希望能给同行人一点帮助。
本文版权归作者growithus和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
原文地址:https://www.cnblogs.com/growithus/p/11012550.html