Spring 的applicationContext.xml路径问题?(ssh中)

来源:百度知道 编辑:UC知道 时间:2024/05/24 22:58:34
我的applicationContext.xml开始在src下,后来我改到WEB—INF下,这个文件就提问找不到了,需要在哪儿配下路径

既然是ssh,那就需要在web.xml中配置一下
用listener
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/:applicationContext.xml,</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

应该是这个样子的

web.xml里面

在web.xml里面,一般是classpath:开头的,修改成相对路径