博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Spring3.2.4集成quartz2.2.1定时任务(demo)
阅读量:6949 次
发布时间:2019-06-27

本文共 3059 字,大约阅读时间需要 10 分钟。

 

 

在JavaEE系统中,我们会经常用到定时任务,下面是我自己写的一个demo.

前面几篇quartz博客感觉看的还是难懂 于是重新整理下

源码地址:

1.所需要的jar

使用maven的pom.xml如下

commons-logging
commons-logging
1.2
log4j
log4j
1.2.17
org.quartz-scheduler
quartz
2.2.2
org.slf4j
slf4j-api
1.7.21
org.slf4j
slf4j-log4j12
1.7.21
org.springframework
spring-aop
4.3.2.RELEASE
org.springframework
spring-beans
4.3.2.RELEASE
org.springframework
spring-context
4.3.2.RELEASE
org.springframework
spring-context-support
4.3.2.RELEASE
org.springframework
spring-core
4.3.2.RELEASE
org.springframework
spring-expression
4.3.2.RELEASE
org.springframework
spring-tx
4.3.2.RELEASE
org.springframework
spring-web
4.3.2.RELEASE

2.实体bean

package com.shanheyongmu.quartz;import java.util.Date;public class Study {    public void doStudy(){        System.out.println("It is"+new Date());    }    }

3.applicationContext.xml

0/5 * * * * ?

 

4.web.xml

contextConfigLocation
/WEB-INF/classes/applicationContext.xml
classpath*:applicationContext.xml
    
org.springframework.web.context.ContextLoaderListener

 http://cron.qqe2.com/  这个是在线quartz时间格式的网站

转载地址:http://ihhnl.baihongyu.com/

你可能感兴趣的文章
nginx的upstream目前支持5种方式的分配
查看>>
android图像处理(3) 底片效果
查看>>
stl 之set图解
查看>>
4.自定义数据《jquery实战》
查看>>
HDU 3569 Imaginary Date 简单期望
查看>>
iOS开发之地域选择
查看>>
activity
查看>>
ROS+nfdump 用户上网日志
查看>>
CSDN日报20170411 ——《怎样给自己的私活项目标价》
查看>>
(转)背包9讲
查看>>
Linux_window与linux之间文件互传,上传下载
查看>>
GDB调试——常用的命令
查看>>
Disruptor多个消费者不重复处理生产者发送过来的消息
查看>>
vuejs_01项目启动
查看>>
[LeetCode] Candy Crush 糖果消消乐
查看>>
04.变量和常量
查看>>
图像采集调试总结
查看>>
iOS适配HTTPS,创建一个自签名的SSL证书(x509)具体步骤
查看>>
1111111
查看>>
XStream将java对象转换为xml时,对象字段中的下划线“_”,转换后变成了两个的解决办法...
查看>>