异常信息如下:
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