No mapping found for HTTP request with URI [/spring.mvc/student/manager] in DispatcherServlet with n

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Maybeno1314/article/details/81630763

 

解决方法,在applicationContext-mvc.xml文件中配置mvc时候只配置了

·<context:component-scan base-package="com.zzxt.spring.mvc.restful.action"></context:component-scan>

后边应该加上:<mvc:annotation-driven />

这样才能实现正确对包的扫描

这是我的工程的解决方法,还有以下解决方案:

web.xml配置文件的<url-pattern>标签配置成<url-pattern>/*</url-pattern> 把其中的“/* 改为 /

猜你喜欢

转载自blog.csdn.net/Maybeno1314/article/details/81630763