您的位置:首页 > 编程语言 > Java开发

Spring与Quartz的结合使用 主要用于定时任务!!!

2014-11-26 14:43 567 查看


[1].[代码] QuartzJob.java Quartz的任务调度 跳至 [1] [2] [3] [4] [5] [6]

?


[2].[代码] 主程序测试代码MainTest.java 跳至 [1] [2] [3] [4] [5] [6]

?


[3].[代码] xml spring配置文件 跳至 [1] [2] [3] [4] [5] [6]

?


[4].[图片] 1111.png 跳至 [1] [2] [3] [4] [5] [6]




[5].[图片] 22222.png 跳至 [1] [2] [3] [4] [5] [6]



如果是web应用
别忘了在web.xml里面配置Spring:

Xml代码


<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://java.sun.com/xml/ns/javaee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">

<welcome-file-list>

<welcome-file>index.html</welcome-file>

</welcome-file-list>

<context-param>

<param-name>contextConfigLocation</param-name>

<param-value>/WEB-INF/spring-config.xml</param-value>

</context-param>

<listener>

<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

</listener>

</web-app>

转载来自:http://www.oschina.net/code/snippet_273576_23470#39199
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: