
在 web.xml文件里面,这段配置的意思是:使用通配符把spring的xml类型文件引入
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring/*.xml</param-value>
</context-param>
创建xml文件quartzContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
default-lazy-init="false">
<bean id="epibLineService" class="com.dcits.service.EpibLineServiceImpl"/>
<bean id="bmRecordService" class="com.dcits.service.BmRecordServiceImpl"/>
<bean id="bmImageService" class="com.dcits.service.BmImageServiceImpl"/>
<bean name="taskJob" class="com.dcits.task.AutoExcute" >
<property name="epibLineService">
<ref bean="epibLineService" />
</property>
<property name="bmRecordService">
<ref bean="bmRecordService" />
</property>
<property name="bmImageService">
<ref bean="bmImageService" />
</property>
</bean>
<bean id="methodInvokingJobDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="taskJob" />
</property>
<property name="targetMethod">
<value>Task</value>
</property>
</bean>
<!-- 配置触发器 -->
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<!-- 这里不可以直接在属性jobDetail中引用taskJob,因为他要求的是一个jobDetail类型的对象,所以我们得通过MethodInvokingJobDetailFactoryBean来转一下 -->
<property name="jobDetail">
<ref bean="methodInvokingJobDetail" />
</property>
<!-- 每天早上五点触发-->
<property name="cronExpression">
<value>0 0 5 * * ?" </value>
</property>
</bean>
<!--
cronExpression的配置说明,具体使用以及参数请百度google
字段 允许值 允许的特殊字符
秒0-59, - * /
分0-59, - * /
小时0-23, - * /
日期1-31, - * ? / L W C
月份1-12 或者 JAN-DEC, - * /
星期1-7 或者 SUN-SAT, - * ? / L C #
年(可选)留空, 1970-2099, - * /
- 区间
* 通配符
? 你不想设置那个字段
下面只例出几个式子
CRON表达式含义
"0 0 12 * * ?"每天中午十二点触发
"0 15 10 ? * *"每天早上10:15触发
"0 15 10 * * ?"每天早上10:15触发
"0 15 10 * * ? *"每天早上10:15触发
"0 15 10 * * ? 2005"2005年的每天早上10:15触发
"0 * 14 * * ?"每天从下午2点开始到2点59分每分钟一次触发
"0 0/5 14 * * ?"每天从下午2点开始到2:55分结束每5分钟一次触发
"0 0/5 14,18 * * ?"每天的下午2点至2:55和6点至6点55分两个时间段内每5分钟一次触发
"0 0-5 14 * * ?"每天14:00至14:05每分钟一次触发
"0 10,44 14 ? 3 WED"三月的每周三的14:10和14:44触发
"0 15 10 ? * MON-FRI"每个周一、周二、周三、周四、周五的10:15触发
-->
<bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<!-- 添加触发器 -->
<property name="triggers">
<list>
<ref local="cronTrigger" />
</list>
</property>
</bean>
</beans>
。。。首先你得明白Struts是干什么。。。Struts它不是用来连接数据库。。。
Struts是实现 业务逻辑层的
修改数据库里的数据,那当然要用到SQL语句。。
redis会周期性的把更新的数据写入磁盘或者把修改 *** 作写入追加的记录文件,并且在此基础上实现了master-slave(主从)同步,当前 Redis的应用已经非常广泛,国内像新浪、淘宝,国外像 Flickr、Github等均在使用Redis的缓存服务。欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)