springmvc web.xml配置的dispatcher-servlet.xml老报找不到

owenG 发布于 2015/12/10 10:33
阅读 3K+
收藏 0

报这样的错误:

Caused by: java.io.FileNotFoundException: class path resource [dispatcher-servlet.xml] cannot be opened because it does not exist

我的目录是这一的:

web.xml配置:

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value />
</context-param>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:dispatcher-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>


加载中
0
GuoYJ
GuoYJ
classpath:/dispatcher-servlet.xml
0
l
limin10292822

我也总是报这样的错误,请问你最后是怎么解决的啊?

返回顶部
顶部