@Target(value=PARAMETER) @Retention(value=RUNTIME) @Documented public @interface RequestHeader
RequestMapping,
RequestParam,
CookieValue,
RequestMappingHandlerAdapter,
AnnotationMethodHandlerAdapter| Modifier and Type | Optional Element and Description |
|---|---|
String |
defaultValue
The default value to use as a fallback.
|
boolean |
required
Whether the header is required.
|
String |
value
The name of the request header to bind to.
|
public abstract String value
public abstract boolean required
Default is true, leading to an exception thrown in case
of the header missing in the request. Switch this to false
if you prefer a null in case of the header missing.
Alternatively, provide a defaultValue(), which implicitly sets
this flag to false.
public abstract String defaultValue
required() to false.