1、配置文件中添加
xmlns:task="http://www.springframework.org/schema/task"
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
打开定时器
<task:annotation-driven/>
2、业务逻辑注解
@Scheduled(cron="0 */1 * * * ?")
public void receive(){
System.out.println(System.currentTimeMillis());
}

1097

被折叠的 条评论
为什么被折叠?



