考虑一下这个
Spring MVC控制器:
@Controller @RequestMapping("/test*") public class TestController { @RequestMapping(method = RequestMethod.GET) public void doStuff(Model model){ ... } @RequestMapping(params = "myParam") public void doStuff(@RequestParam("myParam") int myParam,Model model){ ... } }
当我把它放到我的浏览器中时:
mySite.com/test.html?myParam=1
我期待一个AmbiguousHandlerMappingException或其他东西,因为两个方法似乎都匹配URL.