定时任务写了不少了,可每次用都得从新写,好麻烦,这次上传上来做个备份,以后用到再下载。
web.xml加上节点
<!-- spring init -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/applicationContext.xml,
/WEB-INF/config/xcbContext.xml,
/WEB-INF/config/spring-quartz-task.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
其中,spring-quartz-task.xml是定时任务,从名字也能看出