cause of the problem: The culprit is the configuration of the Dispatcherservlet request URL mapping for spring under Web. XML, which is configured as follows:
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
analysis reason: < Servlet-mapping> <url-pattern>/</url-pattern>
Workaround: Add the following configuration in Web. XML
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.css</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.gif</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.jpg</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping>
Workaround 2: Add the following line to the spring configuration file:
<mvc:default-servlet-handler/>
Note that the required version is spring3.0.5 or higher
Workaround 3
<!--Handles HTTP GET requests for/resources/** by efficiently serving up static resources in the ${webapproot}/resour CES directory--
<mvc:resources mapping= "/resources/**" location= "/resources/"/>
This configuration tells spring how static resources are handled
This article is from the "Jodyrex" blog, make sure to keep this source http://503431920.blog.51cto.com/6681280/1642256
Spring MVC No Mapping found for HTTP request with URI