Class RequestParamMethodArgumentResolver

All Implemented Interfaces:
HandlerMethodArgumentResolver, SyncHandlerMethodArgumentResolver

public class RequestParamMethodArgumentResolver extends AbstractNamedValueSyncArgumentResolver
Resolver for method arguments annotated with @RequestParam from URI query string parameters.

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 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.

Since:
5.0
Author:
Rossen Stoyanchev
See Also:
  • Constructor Details

    • RequestParamMethodArgumentResolver

      public RequestParamMethodArgumentResolver(@Nullable org.springframework.beans.factory.config.ConfigurableBeanFactory factory, org.springframework.core.ReactiveAdapterRegistry registry, boolean useDefaultResolution)
      Class constructor with a default resolution mode flag.
      Parameters:
      factory - a bean factory used for resolving ${...} placeholder and #{...} SpEL expressions in default values, or null if default values are not expected to contain expressions
      registry - for checking reactive type wrappers
      useDefaultResolution - in default resolution mode a method argument that is a simple type, as defined in BeanUtils.isSimpleProperty(java.lang.Class<?>), is treated as a request parameter even if it isn't annotated, the request parameter name is derived from the method parameter name.
  • Method Details