2018年4月13日

spring 配置定时任务Scheduled

摘要: 一:在spring配置的xml文件添加3条命名空间 二:在spring配置的xml文件中添加 三:在某个定时任务类上添加被扫描的注解@Component,以及在定时执行的方法上添加@Scheduled(cron表达式) 四:启动应用,则会在控制台输出 阅读全文

posted @ 2018-04-13 15:06 天生一对 阅读(2718) 评论(0) 推荐(0) 编辑

springboot中使用Scheduled定时任务

摘要: 一:在程序入口类中添加注解@EnableScheduling 二:在一个没有带参数的方法上使用注解Scheduled 三:启动应用则会自动按照cron的规则定时执行任务 阅读全文

posted @ 2018-04-13 14:32 天生一对 阅读(511) 评论(0) 推荐(0) 编辑

导航