java自动运行任务job---quartz的运用(3)
- UID
- 1066743
|
java自动运行任务job---quartz的运用(3)
web.xml 需要引入 basic.xml
<!-- Spring config start -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:basic.xml</param-value>
</context-param>
如果 需要引入多个 xml时记得 contextConfigLocation 变量名不能 重复,否则xml的加载顺序 排在后面的会覆盖前面的。例如下面的配置就没正确引用basic.xml
错误的用法:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<display-name></display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- Spring config start -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:basic.xml</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-hibernate.xml</param-value>
</context-param>
<filter>
正确的用法:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath://*.xml</param-value>
</context-param> |
|
|
|
|
|