#70 - Fixed link build for controllers with type-level mapping parameters.

This commit is contained in:
Dietrich Schulten
2013-05-18 14:01:45 +02:00
committed by Oliver Gierke
parent 0f5afe02ab
commit 3f995ee8f0
2 changed files with 21 additions and 5 deletions

View File

@@ -49,6 +49,7 @@ import org.springframework.web.util.UriTemplate;
*
* @author Ricardo Gladwell
* @author Oliver Gierke
* @author Dietrich Schulten
*/
public class ControllerLinkBuilderFactory implements MethodLinkBuilderFactory<ControllerLinkBuilder> {
@@ -109,10 +110,9 @@ public class ControllerLinkBuilderFactory implements MethodLinkBuilderFactory<Co
UriTemplate template = new UriTemplate(mapping);
Map<String, Object> values = new HashMap<String, Object>();
if (classMappingParameters.hasNext()) {
for (String variable : template.getVariableNames()) {
values.put(variable, classMappingParameters.next());
}
Iterator<String> names = template.getVariableNames().iterator();
while (classMappingParameters.hasNext()) {
values.put(names.next(), classMappingParameters.next());
}
for (BoundMethodParameter parameter : PATH_VARIABLE_ACCESSOR.getBoundParameters(invocation)) {