|
|
|
@ -16,11 +16,11 @@ |
|
|
|
|
|
|
|
|
|
|
|
package org.springframework.web.method.annotation; |
|
|
|
package org.springframework.web.method.annotation; |
|
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Method; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
import java.util.function.Predicate; |
|
|
|
import javax.servlet.http.Part; |
|
|
|
import javax.servlet.http.Part; |
|
|
|
|
|
|
|
|
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.Before; |
|
|
|
@ -29,31 +29,37 @@ import org.junit.Test; |
|
|
|
import org.springframework.beans.propertyeditors.StringTrimmerEditor; |
|
|
|
import org.springframework.beans.propertyeditors.StringTrimmerEditor; |
|
|
|
import org.springframework.core.LocalVariableTableParameterNameDiscoverer; |
|
|
|
import org.springframework.core.LocalVariableTableParameterNameDiscoverer; |
|
|
|
import org.springframework.core.MethodParameter; |
|
|
|
import org.springframework.core.MethodParameter; |
|
|
|
import org.springframework.core.ParameterNameDiscoverer; |
|
|
|
|
|
|
|
import org.springframework.core.annotation.SynthesizingMethodParameter; |
|
|
|
|
|
|
|
import org.springframework.core.convert.support.DefaultConversionService; |
|
|
|
import org.springframework.core.convert.support.DefaultConversionService; |
|
|
|
import org.springframework.mock.web.test.MockHttpServletRequest; |
|
|
|
import org.springframework.mock.web.test.MockHttpServletRequest; |
|
|
|
import org.springframework.mock.web.test.MockHttpServletResponse; |
|
|
|
import org.springframework.mock.web.test.MockHttpServletResponse; |
|
|
|
import org.springframework.mock.web.test.MockMultipartFile; |
|
|
|
import org.springframework.mock.web.test.MockMultipartFile; |
|
|
|
import org.springframework.mock.web.test.MockMultipartHttpServletRequest; |
|
|
|
import org.springframework.mock.web.test.MockMultipartHttpServletRequest; |
|
|
|
import org.springframework.mock.web.test.MockPart; |
|
|
|
import org.springframework.mock.web.test.MockPart; |
|
|
|
import org.springframework.util.ReflectionUtils; |
|
|
|
|
|
|
|
import org.springframework.web.bind.MissingServletRequestParameterException; |
|
|
|
import org.springframework.web.bind.MissingServletRequestParameterException; |
|
|
|
import org.springframework.web.bind.WebDataBinder; |
|
|
|
import org.springframework.web.bind.WebDataBinder; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.RequestPart; |
|
|
|
import org.springframework.web.bind.annotation.RequestPart; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.ValueConstants; |
|
|
|
import org.springframework.web.bind.support.ConfigurableWebBindingInitializer; |
|
|
|
import org.springframework.web.bind.support.ConfigurableWebBindingInitializer; |
|
|
|
import org.springframework.web.bind.support.DefaultDataBinderFactory; |
|
|
|
import org.springframework.web.bind.support.DefaultDataBinderFactory; |
|
|
|
import org.springframework.web.bind.support.WebDataBinderFactory; |
|
|
|
import org.springframework.web.bind.support.WebDataBinderFactory; |
|
|
|
import org.springframework.web.bind.support.WebRequestDataBinder; |
|
|
|
import org.springframework.web.bind.support.WebRequestDataBinder; |
|
|
|
import org.springframework.web.context.request.NativeWebRequest; |
|
|
|
import org.springframework.web.context.request.NativeWebRequest; |
|
|
|
import org.springframework.web.context.request.ServletWebRequest; |
|
|
|
import org.springframework.web.context.request.ServletWebRequest; |
|
|
|
|
|
|
|
import org.springframework.web.method.ResolvableMethod; |
|
|
|
import org.springframework.web.multipart.MultipartException; |
|
|
|
import org.springframework.web.multipart.MultipartException; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.support.MissingServletRequestPartException; |
|
|
|
import org.springframework.web.multipart.support.MissingServletRequestPartException; |
|
|
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.*; |
|
|
|
import static org.junit.Assert.assertArrayEquals; |
|
|
|
import static org.mockito.BDDMockito.*; |
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
|
|
|
|
import static org.junit.Assert.assertFalse; |
|
|
|
|
|
|
|
import static org.junit.Assert.assertNull; |
|
|
|
|
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
import static org.junit.Assert.fail; |
|
|
|
|
|
|
|
import static org.mockito.BDDMockito.given; |
|
|
|
|
|
|
|
import static org.mockito.BDDMockito.mock; |
|
|
|
|
|
|
|
import static org.springframework.core.ResolvableType.forClassWithGenerics; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Test fixture with {@link org.springframework.web.method.annotation.RequestParamMethodArgumentResolver}. |
|
|
|
* Test fixture with {@link org.springframework.web.method.annotation.RequestParamMethodArgumentResolver}. |
|
|
|
@ -66,92 +72,87 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
|
|
|
|
|
|
|
|
private RequestParamMethodArgumentResolver resolver; |
|
|
|
private RequestParamMethodArgumentResolver resolver; |
|
|
|
|
|
|
|
|
|
|
|
private MethodParameter paramNamedDefaultValueString; |
|
|
|
|
|
|
|
private MethodParameter paramNamedStringArray; |
|
|
|
|
|
|
|
private MethodParameter paramNamedMap; |
|
|
|
|
|
|
|
private MethodParameter paramMultipartFile; |
|
|
|
|
|
|
|
private MethodParameter paramMultipartFileList; |
|
|
|
|
|
|
|
private MethodParameter paramMultipartFileArray; |
|
|
|
|
|
|
|
private MethodParameter paramPart; |
|
|
|
|
|
|
|
private MethodParameter paramPartList; |
|
|
|
|
|
|
|
private MethodParameter paramPartArray; |
|
|
|
|
|
|
|
private MethodParameter paramMap; |
|
|
|
|
|
|
|
private MethodParameter paramStringNotAnnot; |
|
|
|
|
|
|
|
private MethodParameter paramMultipartFileNotAnnot; |
|
|
|
|
|
|
|
private MethodParameter paramMultipartFileListNotAnnot; |
|
|
|
|
|
|
|
private MethodParameter paramPartNotAnnot; |
|
|
|
|
|
|
|
private MethodParameter paramRequestPartAnnot; |
|
|
|
|
|
|
|
private MethodParameter paramRequired; |
|
|
|
|
|
|
|
private MethodParameter paramNotRequired; |
|
|
|
|
|
|
|
private MethodParameter paramOptional; |
|
|
|
|
|
|
|
private MethodParameter multipartFileOptional; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private NativeWebRequest webRequest; |
|
|
|
private NativeWebRequest webRequest; |
|
|
|
|
|
|
|
|
|
|
|
private MockHttpServletRequest request; |
|
|
|
private MockHttpServletRequest request; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ResolvableMethod testMethod = ResolvableMethod.on(getClass()).named("handle").build(); |
|
|
|
|
|
|
|
|
|
|
|
@Before |
|
|
|
@Before |
|
|
|
public void setUp() throws Exception { |
|
|
|
public void setUp() throws Exception { |
|
|
|
resolver = new RequestParamMethodArgumentResolver(null, true); |
|
|
|
resolver = new RequestParamMethodArgumentResolver(null, true); |
|
|
|
ParameterNameDiscoverer paramNameDiscoverer = new LocalVariableTableParameterNameDiscoverer(); |
|
|
|
|
|
|
|
Method method = ReflectionUtils.findMethod(getClass(), "handle", (Class<?>[]) null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
paramNamedDefaultValueString = new SynthesizingMethodParameter(method, 0); |
|
|
|
|
|
|
|
paramNamedStringArray = new SynthesizingMethodParameter(method, 1); |
|
|
|
|
|
|
|
paramNamedMap = new SynthesizingMethodParameter(method, 2); |
|
|
|
|
|
|
|
paramMultipartFile = new SynthesizingMethodParameter(method, 3); |
|
|
|
|
|
|
|
paramMultipartFileList = new SynthesizingMethodParameter(method, 4); |
|
|
|
|
|
|
|
paramMultipartFileArray = new SynthesizingMethodParameter(method, 5); |
|
|
|
|
|
|
|
paramPart = new SynthesizingMethodParameter(method, 6); |
|
|
|
|
|
|
|
paramPartList = new SynthesizingMethodParameter(method, 7); |
|
|
|
|
|
|
|
paramPartArray = new SynthesizingMethodParameter(method, 8); |
|
|
|
|
|
|
|
paramMap = new SynthesizingMethodParameter(method, 9); |
|
|
|
|
|
|
|
paramStringNotAnnot = new SynthesizingMethodParameter(method, 10); |
|
|
|
|
|
|
|
paramStringNotAnnot.initParameterNameDiscovery(paramNameDiscoverer); |
|
|
|
|
|
|
|
paramMultipartFileNotAnnot = new SynthesizingMethodParameter(method, 11); |
|
|
|
|
|
|
|
paramMultipartFileNotAnnot.initParameterNameDiscovery(paramNameDiscoverer); |
|
|
|
|
|
|
|
paramMultipartFileListNotAnnot = new SynthesizingMethodParameter(method, 12); |
|
|
|
|
|
|
|
paramMultipartFileListNotAnnot.initParameterNameDiscovery(paramNameDiscoverer); |
|
|
|
|
|
|
|
paramPartNotAnnot = new SynthesizingMethodParameter(method, 13); |
|
|
|
|
|
|
|
paramPartNotAnnot.initParameterNameDiscovery(paramNameDiscoverer); |
|
|
|
|
|
|
|
paramRequestPartAnnot = new SynthesizingMethodParameter(method, 14); |
|
|
|
|
|
|
|
paramRequired = new SynthesizingMethodParameter(method, 15); |
|
|
|
|
|
|
|
paramNotRequired = new SynthesizingMethodParameter(method, 16); |
|
|
|
|
|
|
|
paramOptional = new SynthesizingMethodParameter(method, 17); |
|
|
|
|
|
|
|
multipartFileOptional = new SynthesizingMethodParameter(method, 18); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request = new MockHttpServletRequest(); |
|
|
|
request = new MockHttpServletRequest(); |
|
|
|
webRequest = new ServletWebRequest(request, new MockHttpServletResponse()); |
|
|
|
webRequest = new ServletWebRequest(request, new MockHttpServletResponse()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void supportsParameter() { |
|
|
|
public void supportsParameter() { |
|
|
|
resolver = new RequestParamMethodArgumentResolver(null, true); |
|
|
|
resolver = new RequestParamMethodArgumentResolver(null, true); |
|
|
|
assertTrue(resolver.supportsParameter(paramNamedDefaultValueString)); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(paramNamedStringArray)); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class, value("bar")).arg(String.class); |
|
|
|
assertTrue(resolver.supportsParameter(paramNamedMap)); |
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
assertTrue(resolver.supportsParameter(paramMultipartFile)); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(paramMultipartFileList)); |
|
|
|
param = this.testMethod.annotated(RequestParam.class).arg(String[].class); |
|
|
|
assertTrue(resolver.supportsParameter(paramMultipartFileArray)); |
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
assertTrue(resolver.supportsParameter(paramPart)); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(paramPartList)); |
|
|
|
param = this.testMethod.annotated(RequestParam.class, name("name")).arg(Map.class); |
|
|
|
assertTrue(resolver.supportsParameter(paramPartArray)); |
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
assertFalse(resolver.supportsParameter(paramMap)); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(paramStringNotAnnot)); |
|
|
|
param = this.testMethod.annotated(RequestParam.class).arg(MultipartFile.class); |
|
|
|
assertTrue(resolver.supportsParameter(paramMultipartFileNotAnnot)); |
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
assertTrue(resolver.supportsParameter(paramMultipartFileListNotAnnot)); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(paramPartNotAnnot)); |
|
|
|
param = this.testMethod.annotated(RequestParam.class).arg(forClassWithGenerics(List.class, MultipartFile.class)); |
|
|
|
assertFalse(resolver.supportsParameter(paramRequestPartAnnot)); |
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
assertTrue(resolver.supportsParameter(paramRequired)); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(paramNotRequired)); |
|
|
|
param = this.testMethod.annotated(RequestParam.class).arg(MultipartFile[].class); |
|
|
|
assertTrue(resolver.supportsParameter(paramOptional)); |
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
assertTrue(resolver.supportsParameter(multipartFileOptional)); |
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.annotated(RequestParam.class).arg(Part.class); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.annotated(RequestParam.class).arg(forClassWithGenerics(List.class, Part.class)); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.annotated(RequestParam.class).arg(Part[].class); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.annotated(RequestParam.class, name("")).arg(Map.class); |
|
|
|
|
|
|
|
assertFalse(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.notAnnotated(RequestParam.class).arg(String.class); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.notAnnotated().arg(MultipartFile.class); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.notAnnotated(RequestParam.class).arg(forClassWithGenerics(List.class, MultipartFile.class)); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.notAnnotated(RequestParam.class).arg(Part.class); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.annotated(RequestPart.class).arg(MultipartFile.class); |
|
|
|
|
|
|
|
assertFalse(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.annotated(RequestParam.class, required(), value("")).arg(String.class); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.annotated(RequestParam.class, required().negate()).arg(String.class); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.annotated(RequestParam.class).arg(forClassWithGenerics(Optional.class, Integer.class)); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.annotated(RequestParam.class).arg(forClassWithGenerics(Optional.class, MultipartFile.class)); |
|
|
|
|
|
|
|
assertTrue(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
resolver = new RequestParamMethodArgumentResolver(null, false); |
|
|
|
resolver = new RequestParamMethodArgumentResolver(null, false); |
|
|
|
assertFalse(resolver.supportsParameter(paramStringNotAnnot)); |
|
|
|
|
|
|
|
assertFalse(resolver.supportsParameter(paramRequestPartAnnot)); |
|
|
|
param = this.testMethod.notAnnotated(RequestParam.class).arg(String.class); |
|
|
|
|
|
|
|
assertFalse(resolver.supportsParameter(param)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param = this.testMethod.annotated(RequestPart.class).arg(MultipartFile.class); |
|
|
|
|
|
|
|
assertFalse(resolver.supportsParameter(param)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@ -159,7 +160,8 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
String expected = "foo"; |
|
|
|
String expected = "foo"; |
|
|
|
request.addParameter("name", expected); |
|
|
|
request.addParameter("name", expected); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramNamedDefaultValueString, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class, value("bar")).arg(String.class); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof String); |
|
|
|
assertTrue(result instanceof String); |
|
|
|
assertEquals("Invalid result", expected, result); |
|
|
|
assertEquals("Invalid result", expected, result); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -169,7 +171,8 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
String[] expected = new String[] {"foo", "bar"}; |
|
|
|
String[] expected = new String[] {"foo", "bar"}; |
|
|
|
request.addParameter("name", expected); |
|
|
|
request.addParameter("name", expected); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramNamedStringArray, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class).arg(String[].class); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof String[]); |
|
|
|
assertTrue(result instanceof String[]); |
|
|
|
assertArrayEquals("Invalid result", expected, (String[]) result); |
|
|
|
assertArrayEquals("Invalid result", expected, (String[]) result); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -181,7 +184,8 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.addFile(expected); |
|
|
|
request.addFile(expected); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramMultipartFile, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class).arg(MultipartFile.class); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof MultipartFile); |
|
|
|
assertTrue(result instanceof MultipartFile); |
|
|
|
assertEquals("Invalid result", expected, result); |
|
|
|
assertEquals("Invalid result", expected, result); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -196,7 +200,11 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.addFile(new MockMultipartFile("other", "Hello World 3".getBytes())); |
|
|
|
request.addFile(new MockMultipartFile("other", "Hello World 3".getBytes())); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramMultipartFileList, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod |
|
|
|
|
|
|
|
.annotated(RequestParam.class) |
|
|
|
|
|
|
|
.arg(forClassWithGenerics(List.class, MultipartFile.class)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof List); |
|
|
|
assertTrue(result instanceof List); |
|
|
|
assertEquals(Arrays.asList(expected1, expected2), result); |
|
|
|
assertEquals(Arrays.asList(expected1, expected2), result); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -211,7 +219,8 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.addFile(new MockMultipartFile("other", "Hello World 3".getBytes())); |
|
|
|
request.addFile(new MockMultipartFile("other", "Hello World 3".getBytes())); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramMultipartFileArray, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class).arg(MultipartFile[].class); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof MultipartFile[]); |
|
|
|
assertTrue(result instanceof MultipartFile[]); |
|
|
|
MultipartFile[] parts = (MultipartFile[]) result; |
|
|
|
MultipartFile[] parts = (MultipartFile[]) result; |
|
|
|
assertEquals(2, parts.length); |
|
|
|
assertEquals(2, parts.length); |
|
|
|
@ -228,7 +237,8 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.addPart(expected); |
|
|
|
request.addPart(expected); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramPart, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class).arg(Part.class); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof Part); |
|
|
|
assertTrue(result instanceof Part); |
|
|
|
assertEquals("Invalid result", expected, result); |
|
|
|
assertEquals("Invalid result", expected, result); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -245,7 +255,11 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.addPart(new MockPart("other", "Hello World 3".getBytes())); |
|
|
|
request.addPart(new MockPart("other", "Hello World 3".getBytes())); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramPartList, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod |
|
|
|
|
|
|
|
.annotated(RequestParam.class) |
|
|
|
|
|
|
|
.arg(forClassWithGenerics(List.class, Part.class)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof List); |
|
|
|
assertTrue(result instanceof List); |
|
|
|
assertEquals(Arrays.asList(expected1, expected2), result); |
|
|
|
assertEquals(Arrays.asList(expected1, expected2), result); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -262,7 +276,8 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.addPart(new MockPart("other", "Hello World 3".getBytes())); |
|
|
|
request.addPart(new MockPart("other", "Hello World 3".getBytes())); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramPartArray, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class).arg(Part[].class); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof Part[]); |
|
|
|
assertTrue(result instanceof Part[]); |
|
|
|
Part[] parts = (Part[]) result; |
|
|
|
Part[] parts = (Part[]) result; |
|
|
|
assertEquals(2, parts.length); |
|
|
|
assertEquals(2, parts.length); |
|
|
|
@ -277,7 +292,10 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.addFile(expected); |
|
|
|
request.addFile(expected); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramMultipartFileNotAnnot, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.notAnnotated().arg(MultipartFile.class); |
|
|
|
|
|
|
|
param.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof MultipartFile); |
|
|
|
assertTrue(result instanceof MultipartFile); |
|
|
|
assertEquals("Invalid result", expected, result); |
|
|
|
assertEquals("Invalid result", expected, result); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -291,14 +309,20 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.addFile(expected2); |
|
|
|
request.addFile(expected2); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramMultipartFileListNotAnnot, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod |
|
|
|
|
|
|
|
.notAnnotated(RequestParam.class) |
|
|
|
|
|
|
|
.arg(forClassWithGenerics(List.class, MultipartFile.class)); |
|
|
|
|
|
|
|
param.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof List); |
|
|
|
assertTrue(result instanceof List); |
|
|
|
assertEquals(Arrays.asList(expected1, expected2), result); |
|
|
|
assertEquals(Arrays.asList(expected1, expected2), result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test(expected = MultipartException.class) |
|
|
|
@Test(expected = MultipartException.class) |
|
|
|
public void isMultipartRequest() throws Exception { |
|
|
|
public void isMultipartRequest() throws Exception { |
|
|
|
resolver.resolveArgument(paramMultipartFile, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class).arg(MultipartFile.class); |
|
|
|
|
|
|
|
resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
fail("Expected exception: request is not a multipart request"); |
|
|
|
fail("Expected exception: request is not a multipart request"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -310,7 +334,12 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.setMethod("PUT"); |
|
|
|
request.setMethod("PUT"); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object actual = resolver.resolveArgument(paramMultipartFileListNotAnnot, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod |
|
|
|
|
|
|
|
.notAnnotated(RequestParam.class) |
|
|
|
|
|
|
|
.arg(forClassWithGenerics(List.class, MultipartFile.class)); |
|
|
|
|
|
|
|
param.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object actual = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(actual instanceof List); |
|
|
|
assertTrue(actual instanceof List); |
|
|
|
assertEquals(expected, ((List<?>) actual).get(0)); |
|
|
|
assertEquals(expected, ((List<?>) actual).get(0)); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -318,7 +347,8 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
@Test(expected = MultipartException.class) |
|
|
|
@Test(expected = MultipartException.class) |
|
|
|
public void noMultipartContent() throws Exception { |
|
|
|
public void noMultipartContent() throws Exception { |
|
|
|
request.setMethod("POST"); |
|
|
|
request.setMethod("POST"); |
|
|
|
resolver.resolveArgument(paramMultipartFile, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class).arg(MultipartFile.class); |
|
|
|
|
|
|
|
resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
fail("Expected exception: no multipart content"); |
|
|
|
fail("Expected exception: no multipart content"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -326,7 +356,8 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
public void missingMultipartFile() throws Exception { |
|
|
|
public void missingMultipartFile() throws Exception { |
|
|
|
request.setMethod("POST"); |
|
|
|
request.setMethod("POST"); |
|
|
|
request.setContentType("multipart/form-data"); |
|
|
|
request.setContentType("multipart/form-data"); |
|
|
|
resolver.resolveArgument(paramMultipartFile, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class).arg(MultipartFile.class); |
|
|
|
|
|
|
|
resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
fail("Expected exception: no such part found"); |
|
|
|
fail("Expected exception: no such part found"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -339,21 +370,25 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.addPart(expected); |
|
|
|
request.addPart(expected); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramPartNotAnnot, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.notAnnotated(RequestParam.class).arg(Part.class); |
|
|
|
|
|
|
|
param.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer()); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof Part); |
|
|
|
assertTrue(result instanceof Part); |
|
|
|
assertEquals("Invalid result", expected, result); |
|
|
|
assertEquals("Invalid result", expected, result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void resolveDefaultValue() throws Exception { |
|
|
|
public void resolveDefaultValue() throws Exception { |
|
|
|
Object result = resolver.resolveArgument(paramNamedDefaultValueString, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class, value("bar")).arg(String.class); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertTrue(result instanceof String); |
|
|
|
assertTrue(result instanceof String); |
|
|
|
assertEquals("Invalid result", "bar", result); |
|
|
|
assertEquals("Invalid result", "bar", result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test(expected = MissingServletRequestParameterException.class) |
|
|
|
@Test(expected = MissingServletRequestParameterException.class) |
|
|
|
public void missingRequestParam() throws Exception { |
|
|
|
public void missingRequestParam() throws Exception { |
|
|
|
resolver.resolveArgument(paramNamedStringArray, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class).arg(String[].class); |
|
|
|
|
|
|
|
resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
fail("Expected exception"); |
|
|
|
fail("Expected exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -367,7 +402,9 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
|
|
|
|
|
|
|
|
this.request.addParameter("stringNotAnnot", ""); |
|
|
|
this.request.addParameter("stringNotAnnot", ""); |
|
|
|
|
|
|
|
|
|
|
|
Object arg = resolver.resolveArgument(paramStringNotAnnot, null, webRequest, binderFactory); |
|
|
|
MethodParameter param = this.testMethod.notAnnotated(RequestParam.class).arg(String.class); |
|
|
|
|
|
|
|
param.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer()); |
|
|
|
|
|
|
|
Object arg = resolver.resolveArgument(param, null, webRequest, binderFactory); |
|
|
|
assertNull(arg); |
|
|
|
assertNull(arg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -381,14 +418,18 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
|
|
|
|
|
|
|
|
this.request.addParameter("name", ""); |
|
|
|
this.request.addParameter("name", ""); |
|
|
|
|
|
|
|
|
|
|
|
Object arg = resolver.resolveArgument(paramNotRequired, null, webRequest, binderFactory); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class, required().negate()).arg(String.class); |
|
|
|
|
|
|
|
Object arg = resolver.resolveArgument(param, null, webRequest, binderFactory); |
|
|
|
assertNull(arg); |
|
|
|
assertNull(arg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void resolveSimpleTypeParam() throws Exception { |
|
|
|
public void resolveSimpleTypeParam() throws Exception { |
|
|
|
request.setParameter("stringNotAnnot", "plainValue"); |
|
|
|
request.setParameter("stringNotAnnot", "plainValue"); |
|
|
|
Object result = resolver.resolveArgument(paramStringNotAnnot, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.notAnnotated(RequestParam.class).arg(String.class); |
|
|
|
|
|
|
|
param.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer()); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
|
|
|
|
param.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer()); |
|
|
|
|
|
|
|
|
|
|
|
assertTrue(result instanceof String); |
|
|
|
assertTrue(result instanceof String); |
|
|
|
assertEquals("plainValue", result); |
|
|
|
assertEquals("plainValue", result); |
|
|
|
@ -396,28 +437,34 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
|
|
|
|
|
|
|
|
@Test // SPR-8561
|
|
|
|
@Test // SPR-8561
|
|
|
|
public void resolveSimpleTypeParamToNull() throws Exception { |
|
|
|
public void resolveSimpleTypeParamToNull() throws Exception { |
|
|
|
Object result = resolver.resolveArgument(paramStringNotAnnot, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.notAnnotated(RequestParam.class).arg(String.class); |
|
|
|
|
|
|
|
param.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer()); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertNull(result); |
|
|
|
assertNull(result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test // SPR-10180
|
|
|
|
@Test // SPR-10180
|
|
|
|
public void resolveEmptyValueToDefault() throws Exception { |
|
|
|
public void resolveEmptyValueToDefault() throws Exception { |
|
|
|
this.request.addParameter("name", ""); |
|
|
|
this.request.addParameter("name", ""); |
|
|
|
Object result = resolver.resolveArgument(paramNamedDefaultValueString, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class, value("bar")).arg(String.class); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertEquals("bar", result); |
|
|
|
assertEquals("bar", result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void resolveEmptyValueWithoutDefault() throws Exception { |
|
|
|
public void resolveEmptyValueWithoutDefault() throws Exception { |
|
|
|
this.request.addParameter("stringNotAnnot", ""); |
|
|
|
this.request.addParameter("stringNotAnnot", ""); |
|
|
|
Object result = resolver.resolveArgument(paramStringNotAnnot, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.notAnnotated(RequestParam.class).arg(String.class); |
|
|
|
|
|
|
|
param.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer()); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertEquals("", result); |
|
|
|
assertEquals("", result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void resolveEmptyValueRequiredWithoutDefault() throws Exception { |
|
|
|
public void resolveEmptyValueRequiredWithoutDefault() throws Exception { |
|
|
|
this.request.addParameter("name", ""); |
|
|
|
this.request.addParameter("name", ""); |
|
|
|
Object result = resolver.resolveArgument(paramRequired, null, webRequest, null); |
|
|
|
MethodParameter param = this.testMethod.annotated(RequestParam.class, required(), value("")).arg(String.class); |
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, null); |
|
|
|
assertEquals("", result); |
|
|
|
assertEquals("", result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -428,11 +475,15 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
initializer.setConversionService(new DefaultConversionService()); |
|
|
|
initializer.setConversionService(new DefaultConversionService()); |
|
|
|
WebDataBinderFactory binderFactory = new DefaultDataBinderFactory(initializer); |
|
|
|
WebDataBinderFactory binderFactory = new DefaultDataBinderFactory(initializer); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(paramOptional, null, webRequest, binderFactory); |
|
|
|
MethodParameter param = this.testMethod |
|
|
|
|
|
|
|
.annotated(RequestParam.class) |
|
|
|
|
|
|
|
.arg(forClassWithGenerics(Optional.class, Integer.class)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, binderFactory); |
|
|
|
assertEquals(Optional.empty(), result); |
|
|
|
assertEquals(Optional.empty(), result); |
|
|
|
|
|
|
|
|
|
|
|
this.request.addParameter("name", "123"); |
|
|
|
this.request.addParameter("name", "123"); |
|
|
|
result = resolver.resolveArgument(paramOptional, null, webRequest, binderFactory); |
|
|
|
result = resolver.resolveArgument(param, null, webRequest, binderFactory); |
|
|
|
assertEquals(Optional.class, result.getClass()); |
|
|
|
assertEquals(Optional.class, result.getClass()); |
|
|
|
assertEquals(123, ((Optional) result).get()); |
|
|
|
assertEquals(123, ((Optional) result).get()); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -448,7 +499,11 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
request.addFile(expected); |
|
|
|
request.addFile(expected); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
webRequest = new ServletWebRequest(request); |
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(multipartFileOptional, null, webRequest, binderFactory); |
|
|
|
MethodParameter param = this.testMethod |
|
|
|
|
|
|
|
.annotated(RequestParam.class) |
|
|
|
|
|
|
|
.arg(forClassWithGenerics(Optional.class, MultipartFile.class)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object result = resolver.resolveArgument(param, null, webRequest, binderFactory); |
|
|
|
assertTrue(result instanceof Optional); |
|
|
|
assertTrue(result instanceof Optional); |
|
|
|
assertEquals("Invalid result", expected, ((Optional<?>) result).get()); |
|
|
|
assertEquals("Invalid result", expected, ((Optional<?>) result).get()); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -461,7 +516,12 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
|
|
|
|
|
|
|
|
request.setMethod("POST"); |
|
|
|
request.setMethod("POST"); |
|
|
|
request.setContentType("multipart/form-data"); |
|
|
|
request.setContentType("multipart/form-data"); |
|
|
|
assertEquals(Optional.empty(), resolver.resolveArgument(multipartFileOptional, null, webRequest, binderFactory)); |
|
|
|
|
|
|
|
|
|
|
|
MethodParameter param = this.testMethod |
|
|
|
|
|
|
|
.annotated(RequestParam.class) |
|
|
|
|
|
|
|
.arg(forClassWithGenerics(Optional.class, MultipartFile.class)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertEquals(Optional.empty(), resolver.resolveArgument(param, null, webRequest, binderFactory)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@ -470,10 +530,29 @@ public class RequestParamMethodArgumentResolverTests { |
|
|
|
initializer.setConversionService(new DefaultConversionService()); |
|
|
|
initializer.setConversionService(new DefaultConversionService()); |
|
|
|
WebDataBinderFactory binderFactory = new DefaultDataBinderFactory(initializer); |
|
|
|
WebDataBinderFactory binderFactory = new DefaultDataBinderFactory(initializer); |
|
|
|
|
|
|
|
|
|
|
|
assertEquals(Optional.empty(), resolver.resolveArgument(multipartFileOptional, null, webRequest, binderFactory)); |
|
|
|
MethodParameter param = this.testMethod |
|
|
|
|
|
|
|
.annotated(RequestParam.class) |
|
|
|
|
|
|
|
.arg(forClassWithGenerics(Optional.class, MultipartFile.class)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertEquals(Optional.empty(), resolver.resolveArgument(param, null, webRequest, binderFactory)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Predicate<RequestParam> name(String name) { |
|
|
|
|
|
|
|
return a -> name.equals(a.name()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Predicate<RequestParam> required() { |
|
|
|
|
|
|
|
return RequestParam::required; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Predicate<RequestParam> value(String value) { |
|
|
|
|
|
|
|
return !value.isEmpty() ? |
|
|
|
|
|
|
|
requestParam -> value.equals(requestParam.defaultValue()) : |
|
|
|
|
|
|
|
requestParam -> ValueConstants.DEFAULT_NONE.equals(requestParam.defaultValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings({"unused", "OptionalUsedAsFieldOrParameterType"}) |
|
|
|
public void handle( |
|
|
|
public void handle( |
|
|
|
@RequestParam(name = "name", defaultValue = "bar") String param1, |
|
|
|
@RequestParam(name = "name", defaultValue = "bar") String param1, |
|
|
|
@RequestParam("name") String[] param2, |
|
|
|
@RequestParam("name") String[] param2, |
|
|
|
|