Introduce alias for 'value' attribute in @RequestParam
Issue: SPR-11393
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -21,6 +21,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.servlet.http.Part;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -427,6 +428,7 @@ public class RequestParamMethodArgumentResolverTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void resolveOptional() throws Exception {
|
||||
ConfigurableWebBindingInitializer initializer = new ConfigurableWebBindingInitializer();
|
||||
initializer.setConversionService(new DefaultConversionService());
|
||||
@@ -443,24 +445,24 @@ public class RequestParamMethodArgumentResolverTests {
|
||||
}
|
||||
|
||||
|
||||
public void params(@RequestParam(value = "name", defaultValue = "bar") String param1,
|
||||
public void params(@RequestParam(name = "name", defaultValue = "bar") String param1,
|
||||
@RequestParam("name") String[] param2,
|
||||
@RequestParam("name") Map<?, ?> param3,
|
||||
@RequestParam(value = "mfile") MultipartFile param4,
|
||||
@RequestParam(value = "mfilelist") List<MultipartFile> param5,
|
||||
@RequestParam(value = "mfilearray") MultipartFile[] param6,
|
||||
@RequestParam(value = "pfile") Part param7,
|
||||
@RequestParam(value = "pfilelist") List<Part> param8,
|
||||
@RequestParam(value = "pfilearray") Part[] param9,
|
||||
@RequestParam("mfile") MultipartFile param4,
|
||||
@RequestParam("mfilelist") List<MultipartFile> param5,
|
||||
@RequestParam("mfilearray") MultipartFile[] param6,
|
||||
@RequestParam("pfile") Part param7,
|
||||
@RequestParam("pfilelist") List<Part> param8,
|
||||
@RequestParam("pfilearray") Part[] param9,
|
||||
@RequestParam Map<?, ?> param10,
|
||||
String stringNotAnnot,
|
||||
MultipartFile multipartFileNotAnnot,
|
||||
List<MultipartFile> multipartFileList,
|
||||
Part part,
|
||||
@RequestPart MultipartFile requestPartAnnot,
|
||||
@RequestParam(value = "name") String paramRequired,
|
||||
@RequestParam(value = "name", required=false) String paramNotRequired,
|
||||
@RequestParam(value = "name") Optional<Integer> paramOptional) {
|
||||
@RequestParam("name") String paramRequired,
|
||||
@RequestParam(name = "name", required = false) String paramNotRequired,
|
||||
@RequestParam("name") Optional<Integer> paramOptional) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user