Add headers to data binding values
Closes gh-32676
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
|
||||
[.small]#xref:web/webmvc/mvc-controller/ann-methods/modelattrib-method-args.adoc[See equivalent in the Servlet stack]#
|
||||
|
||||
The `@ModelAttribute` method parameter annotation binds request parameters onto a model
|
||||
object. For example:
|
||||
The `@ModelAttribute` method parameter annotation binds form data, query parameters,
|
||||
URI path variables, and request headers onto a model object. For example:
|
||||
|
||||
[tabs]
|
||||
======
|
||||
@@ -27,6 +27,10 @@ Kotlin::
|
||||
<1> Bind to an instance of `Pet`.
|
||||
======
|
||||
|
||||
Form data and query parameters take precedence over URI variables and headers, which are
|
||||
included only if they don't override request parameters with the same name. Dashes are
|
||||
stripped from header names.
|
||||
|
||||
The `Pet` instance may be:
|
||||
|
||||
* Accessed from the model where it could have been added by a
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
[.small]#xref:web/webflux/controller/ann-methods/modelattrib-method-args.adoc[See equivalent in the Reactive stack]#
|
||||
|
||||
The `@ModelAttribute` method parameter annotation binds request parameters onto a model
|
||||
object. For example:
|
||||
The `@ModelAttribute` method parameter annotation binds request parameters, URI path variables,
|
||||
and request headers onto a model object. For example:
|
||||
|
||||
[tabs]
|
||||
======
|
||||
@@ -31,7 +31,11 @@ fun processSubmit(@ModelAttribute pet: Pet): String { // <1>
|
||||
<1> Bind to an instance of `Pet`.
|
||||
======
|
||||
|
||||
The `Pet` instance may be:
|
||||
Request parameters are a Servlet API concept that includes form data from the request body,
|
||||
and query parameters. URI variables and headers are also included, but only if they don't
|
||||
override request parameters with the same name. Dashes are stripped from header names.
|
||||
|
||||
The `Pet` instance above may be:
|
||||
|
||||
* Accessed from the model where it could have been added by a
|
||||
xref:web/webmvc/mvc-controller/ann-modelattrib-methods.adoc[@ModelAttribute method].
|
||||
|
||||
Reference in New Issue
Block a user