DATACMNS-513 - PagedResourcesAssemblerArgumentResolver now correctly resolves mappings for sub-class invocations.

We're now using the newly introduced method on ControllerLinkBuilderFactory that takes both a type and a method to forward the method the invocation is happening on independently from the method being invoked.
This commit is contained in:
Oliver Gierke
2014-06-05 16:40:27 +02:00
parent 347a883dee
commit d41da583e9
3 changed files with 36 additions and 2 deletions

View File

@@ -101,7 +101,7 @@ public class PagedResourcesAssemblerArgumentResolver implements HandlerMethodArg
private UriComponents resolveBaseUri(MethodParameter parameter) {
try {
Link linkToMethod = linkBuilderFactory.linkTo(parameter.getMethod(), new Object[0]).withSelfRel();
Link linkToMethod = linkBuilderFactory.linkTo(parameter.getDeclaringClass(), parameter.getMethod()).withSelfRel();
return UriComponentsBuilder.fromUriString(linkToMethod.getHref()).build();
} catch (IllegalArgumentException o_O) {
return null;