<property name="cronExpression">
<!-- 每月最后一天的晚上23:00运行 -->
<value>0 0 23 L * ?</value>
</property>
<property name ="cronExpression" >
<value > 0 0 2 * * ? </value > <!-- 每天早上2点触发 -->
</property >
<property name ="cronExpression" >
<value > 0 55 23 L * ? </value > <!-- 每个月最后一天的23点55触发 -->
</property >
<property name ="cronExpression" >
<value > 0 55 23 12 31 ? * </value > <!-- 每年12月31号的23点55分触发 -->
</property >
总的详细配置:
<!--使用spring quartz组件定时每月统计用户的登录次数-->
<bean id="startQuertz" lazy-init="false" autowire="no"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="doMonth" />
</list>
</property>
</bean>
<!-- 每月订单汇总 -->
<bean id="doMonth" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="jobMonthTask" />
</property>
<!-- cron表达式 -->
<property name="cronExpression">
<!-- 每月最后一天的晚上23:00运行 -->
<value>0 0 23 L * ?</value>
</property>
</bean>
<bean id="jobMonthTask"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<!-- 调用的类 -->
<property name="targetObject">
<ref bean="MonthSumAction" />
</property>
<!-- 调用类中的方法 -->
<property name="targetMethod">
<value>execute</value>
</property>
</bean>
<bean id="MonthSumAction" class="com.cj.action.customer.CustomerActivityAction">
</bean>