Jean-Pierre Bergamin opened SPR-13033 and commented
MvcUriComponentsBuilder::fromMethodCall creates wrong URLs with derived controller classes, e.g.:
@RequestMapping("/something")
static class ControllerWithMethods {
@RequestMapping("/else")
HttpEntity<Void> myMethod(@RequestBody Object payload) {
return null;
}
}
@RequestMapping("/extended")
static class ExtendedController extends ControllerWithMethods {
}
UriComponents uriComponents = fromMethodCall(on(ExtendedController.class).myMethod(null)).build();
The URL that is built is http://localhost/something/else instead of http://localhost/extended/else.
The @RequestMapping of the declaring class of the method that is called is used instead of the @RequstMapping of the given controller class.
Affects: 4.1.6
Referenced from: commits 85cf4e6, e41877d