|
|
|
@ -29,7 +29,7 @@ import org.springframework.core.annotation.AliasFor; |
|
|
|
|
* |
|
|
|
|
* <p>Supported for annotated handler methods in Servlet and Portlet environments. |
|
|
|
|
* |
|
|
|
|
* <p>If the method parameter is {@link java.util.Map Map<String, String>} or |
|
|
|
|
* <p>If the method parameter is {@link java.util.Map Map<String, String>}, |
|
|
|
|
* {@link org.springframework.util.MultiValueMap MultiValueMap<String, String>}, |
|
|
|
|
* or {@link org.springframework.http.HttpHeaders HttpHeaders} then the map is |
|
|
|
|
* populated with all header names and values. |
|
|
|
@ -63,17 +63,19 @@ public @interface RequestHeader { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Whether the header is required. |
|
|
|
|
* <p>Default is {@code true}, leading to an exception thrown in case |
|
|
|
|
* of the header missing in the request. Switch this to {@code false} |
|
|
|
|
* if you prefer a {@code null} in case of the header missing. |
|
|
|
|
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly sets |
|
|
|
|
* this flag to {@code false}. |
|
|
|
|
* <p>Defaults to {@code true}, leading to an exception being thrown |
|
|
|
|
* if the header is missing in the request. Switch this to |
|
|
|
|
* {@code false} if you prefer a {@code null} value if the header is |
|
|
|
|
* not present in the request. |
|
|
|
|
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly |
|
|
|
|
* sets this flag to {@code false}. |
|
|
|
|
*/ |
|
|
|
|
boolean required() default true; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The default value to use as a fallback. Supplying a default value implicitly |
|
|
|
|
* sets {@link #required} to {@code false}. |
|
|
|
|
* The default value to use as a fallback. |
|
|
|
|
* <p>Supplying a default value implicitly sets {@link #required} to |
|
|
|
|
* {@code false}. |
|
|
|
|
*/ |
|
|
|
|
String defaultValue() default ValueConstants.DEFAULT_NONE; |
|
|
|
|
|
|
|
|
|