No mapping found for HTTP request with URI [/myMaven/student/findSingleStudent] in DispatcherServlet

这个问题查了好久,最后才发现原来是配置静态资源时出现的问题,记录下来!

在springmvc.xml中配置静态资源:

<!-- 静态资源配置 -->
<mvc:annotation-driven />
<mvc:resources location="/" mapping="/*.html" />  
<mvc:resources location="/css/" mapping="/css/*" />  
<mvc:resources location="/js/" mapping="/js/*" />  
<mvc:resources location="/images/" mapping="/images/*" />  


注意:标红部分必须配置,不然会报错!

猜你喜欢

转载自blog.csdn.net/qq_25313187/article/details/78185135
今日推荐