quartz定時任務實現
適用於spring框架
1.在web.xml檔案中引入spring-quartz.xml檔案。
<!-- 讀取spring配置檔案 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:config/spring.xml; classpath:config/spring-mybatis.xml; classpath:config/spring-quartz.xml; </param-value> </context-param>
2.spring-quartz.xml檔案如下
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="