Allow fallback on field access for argument binding

Closes gh-599
This commit is contained in:
rstoyanchev
2023-04-13 18:37:44 +01:00
parent bf1f4065b4
commit 882ad0eb26
4 changed files with 86 additions and 14 deletions

View File

@@ -1514,6 +1514,10 @@ accordingly. For example:
}
----
TIP: If the target object doesn't have setters, and you can't change that, you can use a
property on `AnnotatedControllerConfigurer` to allow falling back on binding via direct
field access.
By default, if the method parameter name is available (requires the `-parameters` compiler
flag with Java 8+ or debugging info from the compiler), it is used to look up the argument.
If needed, you can customize the name through the annotation, e.g. `@Argument("bookInput")`.