如何使用Spring集成的方式,配置定时任务。

第一步:web.xml中配置servletContext的启动资源

如何使用Spring集成的方式,配置定时任务。

第二步:web项目要增加对应支持的jar文件,quartz.jar,log4j.jar,slf4j.jar,commons-collections-**.jar,commons-logging-**.jar,配置定时任务调度器,cron表达式,启动方法.

如何使用Spring集成的方式,配置定时任务。

项目实测,可用。每5秒钟,定时执行printTime()方法。