revised @RequestParam processing to support CSV-to-array/collection binding with ConversionService (SPR-7479)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3655 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2010-09-08 12:39:57 +00:00
parent 067108d063
commit 83e4e83e7b
@@ -484,23 +484,13 @@ public class HandlerMethodInvoker {
if (multipartRequest != null) {
List<MultipartFile> files = multipartRequest.getFiles(paramName);
if (!files.isEmpty()) {
if (files.size() == 1 && !paramType.isArray() && !Collection.class.isAssignableFrom(paramType)) {
paramValue = files.get(0);
}
else {
paramValue = files;
}
paramValue = (files.size() == 1 ? files.get(0) : files);
}
}
if (paramValue == null) {
String[] paramValues = webRequest.getParameterValues(paramName);
if (paramValues != null) {
if (paramValues.length == 1 && !paramType.isArray() && !Collection.class.isAssignableFrom(paramType)) {
paramValue = paramValues[0];
}
else {
paramValue = paramValues;
}
paramValue = (paramValues.length == 1 ? paramValues[0] : paramValues);
}
}
if (paramValue == null) {