-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug
Milestone
Description
Mike Youngstrom opened SPR-6934 and commented
I have a controller like so:
public class ExampleController {
@RequestMapping(value="/secure/example", headers="accept=text/html",method=RequestMethod.GET)
public String list(@ModelAttribute ExampleModel example, Model model) {
...
}
@RequestMapping(value="/secure/example", headers={"accept=application/xml"}, method=RequestMethod.GET)
public List<ExampleModel> listXml() {
...
}
}
If I submit a request with accept=application/xml,text/html
I would expect that my listXml() method would be resolved before list(). However, because list() is declared first in the class it ends up being the one chosen by AnnotationMethodHandlerAdapter.
It appears that RequestMappingInfoComparator doesn't take into account the order of the accept media types on the request. I believe it should.
Affects: 3.0.1
Referenced from: commits 4f4f3fa
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug