Fix context-relative default value in XML parsing

This commit fixes the default value for the contextRelative attribute of
a RedirectView, when this view is registered via a
RedirectViewController in XML. The value is set to true.

Note that the default value for this is correctly documented in
spring-mvc-4.1.xsd. Also, the documentation and implementation for its
javadoc counterpart also enforces true as a default value.

Issue: SPR-12607
This commit is contained in:
Brian Clozel
2015-01-16 16:13:02 +01:00
parent ab629a0e26
commit 3da9d92bf5
2 changed files with 14 additions and 3 deletions

View File

@@ -140,6 +140,8 @@ class ViewControllerBeanDefinitionParser implements BeanDefinitionParser {
}
if (element.hasAttribute("context-relative")) {
redirectView.getPropertyValues().add("contextRelative", element.getAttribute("context-relative"));
} else {
redirectView.getPropertyValues().add("contextRelative", true);
}
if (element.hasAttribute("keep-query-params")) {
redirectView.getPropertyValues().add("propagateQueryParams", element.getAttribute("keep-query-params"));