异常信息如下:
java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'helloController' bean method
事实上在controller定义方法时并没有重定义,只能说明在配置文件中除了问题。
debug过程时,无意中在*servlet.xaml删去<mvc:annotation-driven />这行代码,却发现问题不再出现了。究竟是什么原因呢?在某个连接中找到了这样的解释:
The problem comes from <mvc:annotation-driven /> XML config tag.
This element does some black magic, and is registering some default RequestMappingHandlerMapping, RequestMappingHandlerAdapter and common classes around as seen in implementation here
参考连接:https://github.com/rstoyanchev/spring-mvc-31-demo/issues/4
本文探讨了Spring MVC中出现的异常状态问题,并给出了具体的解决办法。通过删除<mvc:annotation-driven/>标签,成功解决了Ambiguousmappingfound错误。
1181

被折叠的 条评论
为什么被折叠?



