加入web配置文件!
我创建了一个Java web工程。
在src中有一个配置文件datasource.xml
我想把它加入到web.xml中,应该怎么写路径呀?
web.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
datasource.xml
</param-value>
</context-param>
------解决方案--------------------<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:datasource.xml</param-value>
</context-param>
------解决方案--------------------
------解决方案-------------------- <listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener </listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext*.xml,classpath*:applicationContext*.xml
</param-value>
</context-param>