diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/BindStatus.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/BindStatus.java
index 8d3f0ccb3a..4fd4058ef1 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/BindStatus.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/BindStatus.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-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.
@@ -90,7 +90,7 @@ public class BindStatus {
this.htmlEscape = htmlEscape;
// determine name of the object and property
- String beanName = null;
+ String beanName;
int dotPos = path.indexOf('.');
if (dotPos == -1) {
// property not set, only the object itself
@@ -124,6 +124,9 @@ public class BindStatus {
this.actualValue = this.bindingResult.getRawFieldValue(this.expression);
this.editor = this.bindingResult.findEditor(this.expression, null);
}
+ else {
+ this.actualValue = this.value;
+ }
}
}
else {
@@ -143,8 +146,9 @@ public class BindStatus {
}
if (this.expression != null && !"*".equals(this.expression) && !this.expression.endsWith("*")) {
BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(target);
- this.valueType = bw.getPropertyType(this.expression);
this.value = bw.getPropertyValue(this.expression);
+ this.valueType = bw.getPropertyType(this.expression);
+ this.actualValue = this.value;
}
this.errorCodes = new String[0];
this.errorMessages = new String[0];
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/spring.vm b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/spring.vm
index 7126ab3cd9..9c1af58841 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/spring.vm
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/spring.vm
@@ -107,7 +107,7 @@
*
* @param path the name of the field to bind to
* @param attributes any additional attributes for the element (such as class
- * or CSS styles or size
+ * or CSS styles or size)
*
*#
#macro( springFormInput $path $attributes )
@@ -124,7 +124,7 @@
*
* @param path the name of the field to bind to
* @param attributes any additional attributes for the element (such as class
- * or CSS styles or size
+ * or CSS styles or size)
*
*#
#macro( springFormPasswordInput $path $attributes )
@@ -140,7 +140,7 @@
*
* @param path the name of the field to bind to
* @param attributes any additional attributes for the element (such as class
- * or CSS styles or size
+ * or CSS styles or size)
*
*#
#macro( springFormHiddenInput $path $attributes )
@@ -156,7 +156,7 @@
*
* @param path the name of the field to bind to
* @param attributes any additional attributes for the element (such as class
- * or CSS styles or size
+ * or CSS styles or size)
*
*#
#macro( springFormTextarea $path $attributes )
@@ -178,16 +178,14 @@
* @param path the name of the field to bind to
* @param options a map (value=label) of all the available options
* @param attributes any additional attributes for the element (such as class
- * or CSS styles or size
+ * or CSS styles or size)
*#
#macro( springFormSingleSelect $path $options $attributes )
#springBind($path)
@@ -202,17 +200,15 @@
* @param path the name of the field to bind to
* @param options a map (value=label) of all the available options
* @param attributes any additional attributes for the element (such as class
- * or CSS styles or size
+ * or CSS styles or size)
*#
#macro( springFormMultiSelect $path $options $attributes )
#springBind($path)