mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-20 20:59:07 +00:00
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:
+2
-12
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user