RequestParam, arguments of
type MultipartFile in conjunction with Spring's MultipartResolver
abstraction, and arguments of type jakarta.servlet.http.Part in conjunction
with Servlet multipart requests. This resolver can also be created in default
resolution mode in which simple types (int, long, etc.) not annotated with
@RequestParam are also treated as request parameters with
the parameter name derived from the argument name.
If the method parameter type is Map, the name specified in the
annotation is used to resolve the request parameter String value. The value is
then converted to a Map via type conversion assuming a suitable
Converter or PropertyEditor has been registered.
Or if a request parameter name is not specified the
RequestParamMapMethodArgumentResolver is used instead to provide
access to all request parameters in the form of a map.
A WebDataBinder is invoked to apply type conversion to resolved request
header values that don't yet match the method parameter type.
RequestParamMapMethodArgumentResolver
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final TypeDescriptor | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | RequestParamMethodArgumentResolver(boolean
in default resolution mode a method argument
that is a simple type, as defined in useDefaultResolution)BeanUtils#isSimpleProperty,
is treated as a request parameter even if it isn't annotated, the
request parameter name is derived from the method parameter name.Create a new |
| public | RequestParamMethodArgumentResolver(ConfigurableBeanFactory
a bean factory used for resolving ${...} placeholder
and #{...} SpEL expressions in default values, or beanFactory, boolean null if default
values are not expected to contain expressionsin default resolution mode a method argument
that is a simple type, as defined in useDefaultResolution)BeanUtils#isSimpleProperty,
is treated as a request parameter even if it isn't annotated, the
request parameter name is derived from the method parameter name.Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | contributeMethodArgument(MethodParameter
the controller method parameter (never parameter, Object null)the argument value (possibly value, UriComponentsBuilder null)the builder to update (never builder, Map<String, Object> null)a map to add URI variables to (never uriVariables, ConversionService null)a ConversionService to format values as Strings conversionService)Implements org. UriComponentsBuilder or add to the map with URI variables
to use to expand the URI after all arguments are processed.
|
| protected AbstractNamedValueMethodArgumentResolver. | createNamedValueInfo(MethodParameter
the method parameter parameter)Implements abstract org. NamedValueInfo object for the given method parameter.
|
| protected String | |
| protected void | handleMissingValue(String
the name for the value name, MethodParameter the method parameter parameter, NativeWebRequest the current request request)
Invoked when a named value is required, but resolveName(String, MethodParameter, NativeWebRequest)
returned null and there is no default value.
|
| protected void | handleMissingValueAfterConversion(String
the name for the value name, MethodParameter the method parameter parameter, NativeWebRequest the current request request)
Invoked when a named value is present but becomes null after conversion.
|
| protected void | handleMissingValueInternal(String name, MethodParameter parameter, NativeWebRequest request, boolean missingAfterConversion)
|
| protected Object | resolveName(String
the name of the value being resolved name, MethodParameter the method parameter to resolve to an argument value
(pre-nested in case of a parameter, NativeWebRequest java. declaration)the current request request)Implements abstract org. |
| public boolean | supportsParameter(MethodParameter
the method parameter to check parameter)Implements org.
|
| STRING_TYPE_DESCRIPTOR | back to summary |
|---|---|
| private static final TypeDescriptor STRING_TYPE_DESCRIPTOR | |
| useDefaultResolution | back to summary |
|---|---|
| private final boolean useDefaultResolution | |
| RequestParamMethodArgumentResolver | back to summary |
|---|---|
| public RequestParamMethodArgumentResolver(boolean useDefaultResolution) Create a new
| |
| RequestParamMethodArgumentResolver | back to summary |
|---|---|
| public RequestParamMethodArgumentResolver(ConfigurableBeanFactory beanFactory, boolean useDefaultResolution) Create a new
| |
| contributeMethodArgument | back to summary |
|---|---|
| public void contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String, Object> uriVariables, ConversionService conversionService) Implements org. Doc from org. Process the given method argument and either update the
| |
| createNamedValueInfo | back to summary |
|---|---|
| protected AbstractNamedValueMethodArgumentResolver. Implements abstract org. Create the
| |
| formatUriValue | back to summary |
|---|---|
protected String formatUriValue(ConversionService cs, TypeDescriptor sourceType, Object value)
| |
| handleMissingValue | back to summary |
|---|---|
| protected void handleMissingValue(String name, MethodParameter parameter, NativeWebRequest request) throws Exception Invoked when a named value is required, but
| |
| handleMissingValueAfterConversion | back to summary |
|---|---|
| protected void handleMissingValueAfterConversion(String name, MethodParameter parameter, NativeWebRequest request) throws Exception Invoked when a named value is present but becomes
| |
| handleMissingValueInternal | back to summary |
|---|---|
| protected void handleMissingValueInternal(String name, MethodParameter parameter, NativeWebRequest request, boolean missingAfterConversion) throws Exception | |
| resolveName | back to summary |
|---|---|
| protected Object resolveName(String name, MethodParameter parameter, NativeWebRequest request) throws Exception Implements abstract org. Doc from org. Resolve the given parameter type and value name into an argument value.
| |
| supportsParameter | back to summary |
|---|---|
| public boolean supportsParameter(MethodParameter parameter) Implements org. Supports the following:
| |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| RequestParamNamedValueInfo | back to summary |
|---|---|
| public RequestParamNamedValueInfo() | |
| RequestParamNamedValueInfo | back to summary |
|---|---|
| public RequestParamNamedValueInfo(RequestParam annotation) | |