![No mapping found for HTTP request with URI [] in DispatcherServlet with name 'appServlet' No mapping found for HTTP request with URI [] in DispatcherServlet with name 'appServlet'](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
项目是使用SpringMVC
(1)在浏览器中访问,后台总报错:
No mapping found for HTTP request with URI [] in DispatcherServlet with name 'appServlet'
查了好半天,才发现是Controller没有扫描到。
<mvc:annotation-driven /> <!-- 扫描Controller --> <context:component-scan base-package="com.winner.controller"/>
注意,不是说Controller上写了个@Controller注解就完事了,Spring没扫描到的话这个注解毛用都没有!!!
这么简单的问题遇到好几次,我也是醉了......