控制台报错:
警告: No mapping found for HTTP request with URI [/holy-spring/user/userInfo] in DispatcherServlet with name 'dispatcher'
UserController映射不到,断点都没进去,JsonParserController可以正常打开。
很奇怪,对比了是一样的啊?
难道是 * 号配置路径的问题? 可是我还是不懂为什么有的可以访问有的不行。
烦请过路大神帮忙答疑解惑,多谢!
控制台报错:
警告: No mapping found for HTTP request with URI [/holy-spring/user/userInfo] in DispatcherServlet with name 'dispatcher'
UserController映射不到,断点都没进去,JsonParserController可以正常打开。
很奇怪,对比了是一样的啊?
难道是 * 号配置路径的问题? 可是我还是不懂为什么有的可以访问有的不行。
烦请过路大神帮忙答疑解惑,多谢!
15 回答8.2k 阅读
8 回答6k 阅读
1 回答4.1k 阅读✓ 已解决
3 回答2.2k 阅读✓ 已解决
2 回答3.2k 阅读
2 回答3.9k 阅读
1 回答2.2k 阅读✓ 已解决
我特么,原来是包名写错了。
吃了文化的亏啊。。
配置是没有问题的。
还有就是记得修改mybatis里mapper.xml文件里的路径。
=================================================================
最开始只报了一个
警告: No mapping found for HTTP request with URI [/holy-spring/user/userInfo] in DispatcherServlet with name 'dispatcher'
我也找不到是哪里的问题,后来试着把controller换到可以映射到的controller的同一目录下,报了另一个出错
严重: Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService': No qualifying bean of type [line.moduls.user.service.UserService] found for dependency [line.moduls.user.service.UserService]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)};
才发现是包名拼错了。