public class PathVariableMethodArgumentResolver
extends org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver
An @<code>PathVariable</code> 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 <code>AbstractNamedValueMethodArgumentResolver</code> 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
<code>Converter</code> or PropertyEditor has been registered.
Or if the annotation does not specify name the
<code>RequestParamMapMethodArgumentResolver</code> is used instead to provide
access to all URI variables in a map.
A <code>WebDataBinder</code> is invoked to apply type conversion to resolved path variable values that don't yet match the method parameter type.
| Constructor and Description |
|---|
PathVariableMethodArgumentResolver() |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.NamedValueInfo |
createNamedValueInfo(org.springframework.core.MethodParameter parameter) |
protected void |
handleMissingValue(String name,
org.springframework.core.MethodParameter param) |
protected void |
handleResolvedValue(Object arg,
String name,
org.springframework.core.MethodParameter parameter,
org.springframework.web.method.support.ModelAndViewContainer mavContainer,
org.springframework.web.context.request.NativeWebRequest request) |
protected Object |
resolveName(String name,
org.springframework.core.MethodParameter parameter,
org.springframework.web.context.request.NativeWebRequest request) |
boolean |
supportsParameter(org.springframework.core.MethodParameter parameter) |
public boolean supportsParameter(org.springframework.core.MethodParameter parameter)
protected org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.NamedValueInfo createNamedValueInfo(org.springframework.core.MethodParameter parameter)
createNamedValueInfo in class org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolverprotected Object resolveName(String name, org.springframework.core.MethodParameter parameter, org.springframework.web.context.request.NativeWebRequest request) throws Exception
resolveName in class org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolverExceptionprotected void handleMissingValue(String name, org.springframework.core.MethodParameter param) throws org.springframework.web.bind.ServletRequestBindingException
handleMissingValue in class org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolverorg.springframework.web.bind.ServletRequestBindingExceptionprotected void handleResolvedValue(Object arg, String name, org.springframework.core.MethodParameter parameter, org.springframework.web.method.support.ModelAndViewContainer mavContainer, org.springframework.web.context.request.NativeWebRequest request)
handleResolvedValue in class org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver