From a1471a9266237293e99c01fc16caea5900b3ba81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Wed, 6 Dec 2023 12:18:42 +0100 Subject: [PATCH] Document `@ModelAttribute` usage with native images Closes gh-31767 --- .../controller/ann-methods/modelattrib-method-args.adoc | 5 ++++- .../mvc-controller/ann-methods/modelattrib-method-args.adoc | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/modelattrib-method-args.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/modelattrib-method-args.adoc index 347a025545a..cc95a89739e 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/modelattrib-method-args.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/modelattrib-method-args.adoc @@ -166,4 +166,7 @@ By default, any argument that is not a simple value type (as determined by and is not resolved by any other argument resolver is treated as if it were annotated with `@ModelAttribute`. - +WARNING: When compiling to native images, implicit `@ModelAttribute` as described above does +not allow proper ahead-of-time inference of related data binding reflection hints. As a consequence, +it is recommended to annotate explicitly with `@ModelAttribute` method parameters for such use case +with GraalVM. diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/modelattrib-method-args.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/modelattrib-method-args.adoc index 1136ab94958..67db7d4f57d 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/modelattrib-method-args.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/modelattrib-method-args.adoc @@ -216,4 +216,7 @@ By default, any argument that is not a simple value type (as determined by and is not resolved by any other argument resolver is treated as if it were annotated with `@ModelAttribute`. - +WARNING: When compiling to native images, implicit `@ModelAttribute` as described above does +not allow proper ahead-of-time inference of related data binding reflection hints. As a consequence, +it is recommended to annotate explicitly with `@ModelAttribute` method parameters for such use case +with GraalVM.