You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Mike Youngstrom opened SPR-6934 and commented
I have a controller like so:
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
The text was updated successfully, but these errors were encountered: