Update section on type conversion for web method arguments

Closes gh-26088
This commit is contained in:
Rossen Stoyanchev 2020-11-16 17:01:35 +00:00
parent 238354a081
commit c22a483c3d
2 changed files with 13 additions and 0 deletions

View File

@ -2009,6 +2009,12 @@ By default, simple types (such as `int`, `long`, `Date`, and others) are support
can be customized through a `WebDataBinder` (see <<webflux-ann-initbinder>>) or by registering
`Formatters` with the `FormattingConversionService` (see <<core.adoc#format, Spring Field Formatting>>).
A practical issue in type conversion is the treatment of an empty String source value.
Such a value is treated as missing if it becomes `null` as a result of type conversion.
This can be the case for `Long`, `UUID`, and other target types. If you want to allow `null`
to be injected, either use the `required` flag on the argument annotation, or declare the
argument as `@Nullable`.
[[webflux-ann-matrix-variables]]
==== Matrix Variables

View File

@ -2216,6 +2216,13 @@ type conversion through a `WebDataBinder` (see <<mvc-ann-initbinder>>) or by reg
`Formatters` with the `FormattingConversionService`.
See <<core.adoc#format, Spring Field Formatting>>.
A practical issue in type conversion is the treatment of an empty String source value.
Such a value is treated as missing if it becomes `null` as a result of type conversion.
This can be the case for `Long`, `UUID`, and other target types. If you want to allow `null`
to be injected, either use the `required` flag on the argument annotation, or declare the
argument as `@Nullable`.
[[mvc-ann-matrix-variables]]
==== Matrix Variables