Skip to content

Commit 29ace7d

Browse files
update docs
Signed-off-by: zakaria-shahen <[email protected]>
1 parent ebce9c9 commit 29ace7d

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestheader.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ array or collection of strings or other types known to the type conversion syste
6464
example, a method parameter annotated with `@RequestHeader("Accept")` may be of type
6565
`String` but also of `String[]` or `List<String>`.
6666

67-
We can further remove our dependency on Spring Web MVC by making `@RequestHeader` a meta-annotation on our own annotation. The next example demonstrates how we could do so on an annotation named `@LanguageRequestHeader`.
67+
We can use `@RequestHeader` as a meta-annotation, so you can create custom annotations for repeatedly used headers, like the `Accept-Language` header.
68+
The next example demonstrates how we could do this with an annotation named `@LanguageRequestHeader`:
6869

6970
[tabs]
7071
======
@@ -91,7 +92,7 @@ annotation class LanguageRequestHeader
9192
----
9293
======
9394

94-
We have isolated our dependency on Spring MVC to a single file. Now that `@LanguageRequestHeader` has been specified, we can use it to signal to resolve our LanguageRequestHeader of the currently `Accept-Language` request header:
95+
Now that `@LanguageRequestHeader` has been specified, we can use it to signal Spring to resolve our `@LanguageRequestHeader` from the current `Accept-Language` request header:
9596

9697
[tabs]
9798
======
@@ -119,4 +120,4 @@ fun fetchProduct(@LanguageRequestHeader lang: String): Flux<Product> {
119120
======
120121

121122

122-
TIP: We can replace the lang parameter type from `String` to `java.util.Locale` or to our own Language enum, and Spring will handle the conversion of the header value.
123+
TIP: We can replace the lang parameter type from `String` to `java.util.Locale` or to your own Language enum, and Spring will handle the conversion of the header value. You may need to implement the xref:core/validation/convert.adoc[`Converter`] interface and register it.

framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestheader.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ array or collection of strings or other types known to the type conversion syste
6464
example, a method parameter annotated with `@RequestHeader("Accept")` can be of type
6565
`String` but also `String[]` or `List<String>`.
6666

67-
We can further remove our dependency on Spring Web MVC by making `@RequestHeader` a meta-annotation on our own annotation. The next example demonstrates how we could do so on an annotation named `@LanguageRequestHeader`.
67+
68+
We can use `@RequestHeader` as a meta-annotation, so you can create custom annotations for repeatedly used headers, like the `Accept-Language` header.
69+
The next example demonstrates how we could do this with an annotation named `@LanguageRequestHeader`:
6870

6971
[tabs]
7072
======
@@ -91,7 +93,7 @@ annotation class LanguageRequestHeader
9193
----
9294
======
9395

94-
We have isolated our dependency on Spring MVC to a single file. Now that `@LanguageRequestHeader` has been specified, we can use it to signal to resolve our LanguageRequestHeader of the currently `Accept-Language` request header:
96+
Now that `@LanguageRequestHeader` has been specified, we can use it to signal Spring to resolve our `@LanguageRequestHeader` from the current `Accept-Language` request header:
9597

9698
[tabs]
9799
======
@@ -119,4 +121,4 @@ fun fetchProduct(@LanguageRequestHeader lang: String): List<Product> {
119121
======
120122

121123

122-
TIP: We can replace the lang parameter type from `String` to `java.util.Locale` or to our own Language enum, and Spring will handle the conversion of the header value.
124+
TIP: We can replace the lang parameter type from `String` to `java.util.Locale` or to your own Language enum, and Spring will handle the conversion of the header value. You may need to implement the xref:core/validation/convert.adoc[`Converter`] interface and register it.

spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
*
3838
* @author Juergen Hoeller
3939
* @author Sam Brannen
40-
* @author Zakaria Shahen
4140
* @since 3.0
4241
* @see RequestMapping
4342
* @see RequestParam

0 commit comments

Comments
 (0)