Springmvc adds timed tasks

Add the following configuration to the springmvc.xml file

<bean id="ClearTempRoomLogTask" class="com.test.listener.StartTimeTask"></bean>
<task:scheduled-tasks>
   <task:scheduled ref="ClearTempRoomLogTask" method="execute"
        cron="0 0 0 1 * ?" />
</task:scheduled-tasks>

Where class="com.test.listener.StartTimeTask" points to the corresponding java class

cron="0 0 0 0 * ?" means to execute a scheduled task at 1 am every day (refer to http://rainbowdesert.iteye.com/blog/2107220)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325071169&siteId=291194637