Announcement Announcement Module
Collapse
No announcement yet.
Regression in mvc annotation method selection from 3.0.5 to 3.1m2? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Regression in mvc annotation method selection from 3.0.5 to 3.1m2?

    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

    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;
    	}
    In 3.0.5 the htmlView would get selected. in 3.1m2 the jsonView is getting selected.

    Is this a regression or expected?
    Mike

  • #2
    I decided to create an issue: https://jira.springsource.org/browse/SPR-8536

    Comment

    Working...
    X