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)