Polishing

This commit is contained in:
Juergen Hoeller
2015-12-13 01:14:38 +01:00
parent 04f765506e
commit ef1e17fd15
6 changed files with 48 additions and 43 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 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.
@@ -21,7 +21,6 @@ import java.util.Map;
import org.w3c.dom.Element;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConstructorArgumentValues;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.parsing.BeanComponentDefinition;
import org.springframework.beans.factory.support.ManagedMap;
@@ -134,21 +133,25 @@ class ViewControllerBeanDefinitionParser implements BeanDefinitionParser {
}
private RootBeanDefinition getRedirectView(Element element, HttpStatus status, Object source) {
ConstructorArgumentValues cavs = new ConstructorArgumentValues();
cavs.addIndexedArgumentValue(0, element.getAttribute("redirect-url"));
RootBeanDefinition redirectView = new RootBeanDefinition(RedirectView.class, cavs, null);
RootBeanDefinition redirectView = new RootBeanDefinition(RedirectView.class);
redirectView.setSource(source);
redirectView.getConstructorArgumentValues().addIndexedArgumentValue(0, element.getAttribute("redirect-url"));
if (status != null) {
redirectView.getPropertyValues().add("statusCode", status);
}
if (element.hasAttribute("context-relative")) {
redirectView.getPropertyValues().add("contextRelative", element.getAttribute("context-relative"));
} else {
}
else {
redirectView.getPropertyValues().add("contextRelative", true);
}
if (element.hasAttribute("keep-query-params")) {
redirectView.getPropertyValues().add("propagateQueryParams", element.getAttribute("keep-query-params"));
}
return redirectView;
}