Reverse SPR-10402 change that caused 3.2.3 regression

SPR-10402 in Spring Framework 3.2.3 treated empty request parameter
values as missing values, if the empty value was turned into a null
by a PropertyEditor or Converter. This caused the regression.

Issue: SPR-10578, SPR-10402, SPR-10584
This commit is contained in:
Rossen Stoyanchev
2013-06-20 16:20:01 -04:00
parent 5feac07738
commit 2d8315fba0
2 changed files with 32 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
@@ -97,17 +97,11 @@ public abstract class AbstractNamedValueMethodArgumentResolver implements Handle
arg = resolveDefaultValue(namedValueInfo.defaultValue);
}
boolean emptyArgValue = "".equals(arg);
if (binderFactory != null) {
WebDataBinder binder = binderFactory.createBinder(webRequest, null, namedValueInfo.name);
arg = binder.convertIfNecessary(arg, paramType, parameter);
}
if (emptyArgValue && (arg == null)) {
handleMissingValue(namedValueInfo.name, parameter);
}
handleResolvedValue(arg, namedValueInfo.name, parameter, mavContainer, webRequest);
return arg;