@Target(value=PARAMETER)
@Retention(value=RUNTIME)
@Documented
public @interface PathVariable
RequestMapping
annotated handler methods in Servlet
environments.
If the method parameter is Map<String, String>
or
MultiValueMap<String, String>
then the map is populated with all path variable names and values.
RequestMapping
,
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
@AliasFor(value="name") public abstract java.lang.String value
name()
.@AliasFor(value="value") public abstract java.lang.String name
public abstract boolean required
Defaults to true
, leading to an exception being thrown if the path
variable is missing in the incoming request. Switch this to false
if
you prefer a null
or Java 8 java.util.Optional
in this case.
e.g. on a ModelAttribute
method which serves for different requests.