首页 > 代码库 > org.springframework.web.servlet.DispatcherServlet异常

org.springframework.web.servlet.DispatcherServlet异常

org.springframework.web.servlet.DispatcherServlet: No mapping found for HTTP request with URI [/] in DispatcherServlet with name ‘springMVC‘

 

出现该异常的原因是web.xml中关于springMVC核心DispatcherServlet的配置出现错误

核心配置为:

<servlet>
<servlet-name>SpringMVC-servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:SpringMVC-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>SpringMVC-servlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

org.springframework.web.servlet.DispatcherServlet异常