I recently upgraded my application from 3.0.5 to 3.1m2. In my application spring mvc is choosing a different method then it used to without any changes in annotations. I know that a lot of work has gone into changing method routing based on headers and content types and stuff so if this is expected that is fine I just though I'd bring it to your attention in case it isn't expected. The case is this:
accept = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
In 3.0.5 the htmlView would get selected. in 3.1m2 the jsonView is getting selected.Code:@RequestMapping(value="/secure/ajaxExample", method=RequestMethod.GET) public String htmlView(@ModelAttribute Example example, Model model) { return "example/manageAjaxExample"; } @RequestMapping(value="/secure/ajaxExample", headers="accept=application/json", method=RequestMethod.GET) public @ResponseBody List<ExampleDto> jsonView() { List<ExampleDto> exampleDtos = new ArrayList<ExampleDto>(); for(Example example : exampleService.getAllExamples()) { exampleDtos.add(convertExampleToExampleDto(example)); } return exampleDtos; }
Is this a regression or expected?
Mike


Reply With Quote