diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java index 0eedccc746..d1781ec964 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java @@ -30,7 +30,7 @@ import org.springframework.core.annotation.AliasFor; *

Supported for annotated handler methods in Servlet and Portlet environments. * *

The method parameter may be declared as type {@link javax.servlet.http.Cookie} - * or as cookie value type (String, int, etc). + * or as cookie value type (String, int, etc.). * * @author Juergen Hoeller * @author Sam Brannen @@ -62,19 +62,20 @@ public @interface CookieValue { String name() default ""; /** - * Whether the header is required. - *

Default is {@code true}, leading to an exception being thrown - * in case the header is missing in the request. Switch this to - * {@code false} if you prefer a {@code null} in case of the - * missing header. - *

Alternatively, provide a {@link #defaultValue}, which implicitly sets - * this flag to {@code false}. + * Whether the cookie is required. + *

Defaults to {@code true}, leading to an exception being thrown + * if the cookie is missing in the request. Switch this to + * {@code false} if you prefer a {@code null} value if the cookie is + * not present in the request. + *

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. + *

Supplying a default value implicitly sets {@link #required} to + * {@code false}. */ String defaultValue() default ValueConstants.DEFAULT_NONE; diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java index a3e433216d..08a910488d 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java @@ -29,7 +29,7 @@ import org.springframework.core.annotation.AliasFor; * *

Supported for annotated handler methods in Servlet and Portlet environments. * - *

If the method parameter is {@link java.util.Map Map<String, String>} or + *

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. - *

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. - *

Alternatively, provide a {@link #defaultValue}, which implicitly sets - * this flag to {@code false}. + *

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. + *

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. + *

Supplying a default value implicitly sets {@link #required} to + * {@code false}. */ String defaultValue() default ValueConstants.DEFAULT_NONE; diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java index 170017e819..8b1d26f661 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java @@ -71,18 +71,20 @@ public @interface RequestParam { /** * Whether the parameter is required. - *

Default is {@code true}, leading to an exception thrown in case - * of the parameter missing in the request. Switch this to {@code false} - * if you prefer a {@code null} in case of the parameter missing. - *

Alternatively, provide a {@link #defaultValue() defaultValue}, - * which implicitly sets this flag to {@code false}. + *

Defaults to {@code true}, leading to an exception being thrown + * if the parameter is missing in the request. Switch this to + * {@code false} if you prefer a {@code null} value if the parameter is + * not present in the request. + *

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 when the request parameter value - * is not provided or empty. Supplying a default value implicitly sets - * {@link #required()} to false. + * The default value to use as a fallback when the request parameter is + * not provided or has an empty value. + *

Supplying a default value implicitly sets {@link #required} to + * {@code false}. */ String defaultValue() default ValueConstants.DEFAULT_NONE; diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java index ade9e957ec..39319aa452 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java @@ -71,7 +71,7 @@ public @interface RequestPart { String value() default ""; /** - * The name of the part in the "multipart/form-data" request to bind to. + * The name of the part in the {@code "multipart/form-data"} request to bind to. * @since 4.2 */ @AliasFor(attribute = "value") @@ -79,9 +79,10 @@ public @interface RequestPart { /** * Whether the part is required. - *

Default is {@code true}, leading to an exception being thrown - * in case the part is missing in the request. Switch this to - * {@code false} if you prefer a {@code null} if the part is missing. + *

Defaults to {@code true}, leading to an exception being thrown + * if the part is missing in the request. Switch this to + * {@code false} if you prefer a {@code null} value if the part is + * not present in the request. */ boolean required() default true;