#114 - Support for type mappings on sub-types in ControllerLinkBuilder.

When building links for method invocations we previously only inspected the type that declared the method for type level mappings. We now use the type the method was invoked on explicitly.
This commit is contained in:
Oliver Gierke
2014-05-01 18:18:06 +02:00
parent 2c6fa4d1b3
commit c9675640f2
6 changed files with 135 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 the original author or authors.
* Copyright 2012-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -103,7 +103,7 @@ public class ControllerLinkBuilderFactory implements MethodLinkBuilderFactory<Co
Iterator<Object> classMappingParameters = invocations.getObjectParameters();
Method method = invocation.getMethod();
String mapping = DISCOVERER.getMapping(method);
String mapping = DISCOVERER.getMapping(invocation.getTargetType(), method);
UriComponentsBuilder builder = ControllerLinkBuilder.getBuilder().path(mapping);
UriTemplate template = new UriTemplate(mapping);