[Html] <? Xml version = "1.0" encoding = "UTF-8"?> <! DOCTYPE beans PUBLIC "-// SPRING // dtd bean // EN" "spring-beans.dtd"> <beans> <! -- <Bean id = "reportManagerImpl" class = "org. springframework. scheduling. quartz. jobDetailBean "> <property name =" jobClass "ref =" reportManager "/> </bean> --> <span style =" color: # FF6666; "> <bean id =" reportManagerImpl_month "class =" org. springframework. scheduling. quartz. methodInvokingJobDetailFactoryBean "> <property name =" targetObject "ref =" reportManager "/> <property name =" targetMethod "value =" addMonthRep Ort "/> </bean> </span> <bean id =" reportManagerImpl_week "class =" org. springframework. scheduling. quartz. methodInvokingJobDetailFactoryBean "> <property name =" targetObject "ref =" reportManager "/> <property name =" targetMethod "value =" addWeekReport "/> </bean> <bean id =" reportManagerImpl_xun "class =" org. springframework. scheduling. quartz. methodInvokingJobDetailFactoryBean "> <property name =" targetObject" Ref = "reportManager"/> <property name = "targetMethod" value = "addXunReport"/> </bean> <! -- Alert message generation reminder --> <bean id = "checkXunAndMail" class = "org. springframework. scheduling. quartz. methodInvokingJobDetailFactoryBean "> <property name =" targetObject "ref =" reportManager "/> <property name =" targetMethod "value =" checkXunAndMail "/> </bean> <span style =" color: # FF6666; "> <bean id =" monthReportTrigger "class =" org. springframework. scheduling. quartz. cronTriggerBean "> <property name =" jobDetail "ref =" report ManagerImpl_month "/> <! -- The key is to configure this expression --> <property name = "cronExpression"> <value> 0 0 17 1C *? </Value> <! -- 0 0 17 1C is triggered at on the first day of each month *? --> </Property> </bean> </span> <bean id = "weekReportTrigger" class = "org. springframework. scheduling. quartz. cronTriggerBean "> <property name =" jobDetail "ref =" reportManagerImpl_week "/> <! -- The key is to configure this expression --> <property name = "cronExpression"> <! -- 0 0 00 is triggered at every Monday? * MON --> <value> 0 0 0? * MON </value> </property> </bean> <bean id = "xunReportTrigger" class = "org. springframework. scheduling. quartz. cronTriggerBean "> <property name =" jobDetail "ref =" reportManagerImpl_xun "/> <! -- The key is to configure this expression --> <property name = "cronExpression"> <! -- 0 0 00 is triggered at every two weeks and weekends? * MON/2 --> <value> 0 0 0? * MON/2 </value> </property> </bean> <! -- Alert message generation reminder --> <bean id = "xunReportMailTrigger" class = "org. springframework. scheduling. quartz. cronTriggerBean "> <property name =" jobDetail "ref =" checkXunAndMail "/> <! -- The key is to configure this expression --> <property name = "cronExpression"> <! -- 0 0 10 is triggered at every Monday? * MON --> <value> 0 0 10? * MON </value> </property> </bean> <span style = "color: # FF6666;"> <bean id = "schedid" class = "org. springframework. scheduling. quartz. schedulerFactoryBean "> <property name =" triggers "> <list> <ref bean =" monthReportTrigger "/> <ref bean =" weekReportTrigger "/> <! -- <Ref bean = "xunReportTrigger"/> --> <ref bean = "xunReportMailTrigger"/> </list> </property> </bean> </span> </beans> www.2cto.com uses the red code as an example. Spring comes with a timer that sets the date in a certain format and then executes the corresponding method of the corresponding class. From the bottom up: scheduler is used to execute all the triggers. That is to say, the configured trigger is used for execution. What kind of attributes are each trigger? Look up, the second paragraph is the red code. A trigger is configured here, with the trigger time configuration and the trigger object configuration. The trigger time configuration is not mentioned here. You can find it by checking the information. The trigger object is configured as reportManagerImpl_month. What attributes are corresponding to this object. Let's look at the first red code. <Property name = "targetObject" ref = "reportManager"/> <property name = "targetMethod" value = "addMonthReport"/> here, targetObject refers to the class reportManager of the trigger object. Of course, this class has already been registered in spring. Here, you can directly use the bean id. TargetMethod refers to the trigger method. When the trigger condition is met, the addMonthReport method is automatically executed. Note: 1. Three layers or four-layer structure must be written separately, not only in line with the syntax structure, but also in a clearer way. 2. Fill in the time. If you want to test more and check more information, you cannot take it for granted. 3. targetObject must be registered in spring. The above file must be imported in the configuration file. This is common sense.