Class PathVariableMethodArgumentResolver

java.lang.Object
org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver
org.springframework.web.servlet.mvc.method.annotation.PathVariableMethodArgumentResolver
All Implemented Interfaces:
HandlerMethodArgumentResolver, UriComponentsContributor

public class PathVariableMethodArgumentResolver extends AbstractNamedValueMethodArgumentResolver implements UriComponentsContributor
Resolves method arguments annotated with an @PathVariable.

An @PathVariable is a named value that gets resolved from a URI template variable. It is always required and does not have a default value to fall back on. See the base class AbstractNamedValueMethodArgumentResolver for more information on how named values are processed.

If the method parameter type is Map, the name specified in the annotation is used to resolve the URI variable String value. The value is then converted to a Map via type conversion, assuming a suitable Converter or PropertyEditor has been registered.

A WebDataBinder is invoked to apply type conversion to resolved path variable values that don't yet match the method parameter type.

Since:
3.1
Author:
Rossen Stoyanchev, Arjen Poutsma, Juergen Hoeller