我知道类似的问题问很多时间,但我不明白什么是错的。帮我解决这个问题。我尝试运行我的应用程序用SpringMVC但我得到:解析XML ServletContext资源BeanDefinitionStoreException
11月 - 2017年13:06:29.471严重[RMI TCP连接(2)-127.0.0.1]
org.springframework.beans.factory .BeanDefinitionStoreException: IOException从ServletContext资源解析XML文档 [/WEB-INF/applicationContext.xml];嵌套的例外是 java.io.FileNotFoundException:无法打开ServletContext的资源
我设置文件路径web.xml
classpath:spring-context.xml
:
<!-- Creates the Spring Container shared by all Servlets and Filters -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Process application servlet -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring-context.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
项目结构:
你是什么意思_pasing为param_? – Pavel
使用标签param-name和param-value将参数传递给ContextConfig的构造函数Location –