fixed DataBinder's conversion error handling for direct field access with ConversionService (SPR-6953)

This commit is contained in:
Juergen Hoeller
2010-03-24 17:40:45 +00:00
parent 65b0a8fcb2
commit 53b6e1c1b0
4 changed files with 99 additions and 7 deletions

View File

@@ -495,7 +495,11 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
* property values, as an alternative to JavaBeans PropertyEditors.
*/
public void setConversionService(ConversionService conversionService) {
Assert.state(this.conversionService == null, "DataBinder is already initialized with ConversionService");
this.conversionService = conversionService;
if (this.bindingResult != null && conversionService != null) {
this.bindingResult.initConversion(conversionService);
}
}
/**