Browse Source

Update section on type conversion for web method arguments

Closes gh-26088
pull/26100/head
Rossen Stoyanchev 5 years ago
parent
commit
c22a483c3d
  1. 6
      src/docs/asciidoc/web/webflux.adoc
  2. 7
      src/docs/asciidoc/web/webmvc.adoc

6
src/docs/asciidoc/web/webflux.adoc

@ -2009,6 +2009,12 @@ By default, simple types (such as `int`, `long`, `Date`, and others) are support @@ -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

7
src/docs/asciidoc/web/webmvc.adoc

@ -2216,6 +2216,13 @@ type conversion through a `WebDataBinder` (see <<mvc-ann-initbinder>>) or by reg @@ -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

Loading…
Cancel
Save