Top Description Constructors Methods
org.springframework.web.method.annotation

public Class RequestParamMapMethodArgumentResolver

extends Object
implements HandlerMethodArgumentResolver
Class Inheritance
All Implemented Interfaces
org.springframework.web.method.support.HandlerMethodArgumentResolver
Imports
java.util.Collection, .LinkedHashMap, .Map, jakarta.servlet.http.HttpServletRequest, .Part, org.springframework.core.MethodParameter, .ResolvableType, org.springframework.lang.Nullable, org.springframework.util.CollectionUtils, .LinkedMultiValueMap, .MultiValueMap, .StringUtils, org.springframework.web.bind.annotation.RequestParam, org.springframework.web.bind.support.WebDataBinderFactory, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.method.support.HandlerMethodArgumentResolver, .ModelAndViewContainer, org.springframework.web.multipart.MultipartFile, .MultipartRequest, org.springframework.web.multipart.support.MultipartResolutionDelegate

Resolves Map method arguments annotated with an @RequestParam where the annotation does not specify a request parameter name.

The created Map contains all request parameter name/value pairs, or all multipart files for a given parameter name if specifically declared with MultipartFile as the value type. If the method parameter type is MultiValueMap instead, the created map contains all request parameters and all their values for cases where request parameters have multiple values (or multiple multipart files of the same name).

Authors
Arjen Poutsma, Rossen Stoyanchev, Juergen Hoeller
Since
3.1
See Also
RequestParamMethodArgumentResolver, HttpServletRequest#getParameterMap(), MultipartRequest#getMultiFileMap(), MultipartRequest#getFileMap()

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
resolveArgument(MethodParameter
the method parameter to resolve. This parameter must have previously been passed to supportsParameter which must have returned true.
parameter
,
ModelAndViewContainer
the ModelAndViewContainer for the current request
mavContainer
,
NativeWebRequest
the current request
webRequest
,
WebDataBinderFactory
a factory for creating WebDataBinder instances
binderFactory
)

Implements org.springframework.web.method.support.HandlerMethodArgumentResolver.resolveArgument.

Resolves a method parameter into an argument value from a given request.

public boolean
supportsParameter(MethodParameter
the method parameter to check
parameter
)

Implements org.springframework.web.method.support.HandlerMethodArgumentResolver.supportsParameter.

Whether the given method parameter is supported by this resolver.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RequestParamMapMethodArgumentResolverback to summary
public RequestParamMapMethodArgumentResolver()

Method Detail

resolveArgumentback to summary
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception

Implements org.springframework.web.method.support.HandlerMethodArgumentResolver.resolveArgument.

Doc from org.springframework.web.method.support.HandlerMethodArgumentResolver.resolveArgument.

Resolves a method parameter into an argument value from a given request. A ModelAndViewContainer provides access to the model for the request. A WebDataBinderFactory provides a way to create a WebDataBinder instance when needed for data binding and type conversion purposes.

Parameters
parameter:MethodParameter

the method parameter to resolve. This parameter must have previously been passed to supportsParameter which must have returned true.

mavContainer:ModelAndViewContainer

the ModelAndViewContainer for the current request

webRequest:NativeWebRequest

the current request

binderFactory:WebDataBinderFactory

a factory for creating WebDataBinder instances

Returns:Object

the resolved argument value, or null if not resolvable

Annotations
@Override
Exceptions
Exception:
in case of errors with the preparation of argument values
supportsParameterback to summary
public boolean supportsParameter(MethodParameter parameter)

Implements org.springframework.web.method.support.HandlerMethodArgumentResolver.supportsParameter.

Doc from org.springframework.web.method.support.HandlerMethodArgumentResolver.supportsParameter.

Whether the given method parameter is supported by this resolver.

Parameters
parameter:MethodParameter

the method parameter to check

Returns:boolean

true if this resolver supports the supplied parameter; false otherwise

Annotations
@Override