Skip to content

Commit 2e3d133

Browse files
committed
Document @ModelAttribute usage with native images
Closes gh-31765
1 parent 448e753 commit 2e3d133

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/modelattrib-method-args.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,7 @@ value type as determined by
200200
{spring-framework-api}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty]
201201
_AND_ that is not resolved by any other argument resolver is treated as an `@ModelAttribute`.
202202

203-
203+
WARNING: When compiling to native images, implicit `@ModelAttribute` as described above does
204+
not allow proper ahead-of-time inference of related data binding reflection hints. As a consequence,
205+
it is recommended to annotate explicitly with `@ModelAttribute` method parameters for such use case
206+
with GraalVM.

framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/modelattrib-method-args.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,8 @@ TIP: Using `@ModelAttribute` is optional. By default, any parameter that is not
244244
value type as determined by
245245
{spring-framework-api}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty]
246246
_AND_ that is not resolved by any other argument resolver is treated as an `@ModelAttribute`.
247+
248+
WARNING: When compiling to native images, implicit `@ModelAttribute` as described above does
249+
not allow proper ahead-of-time inference of related data binding reflection hints. As a consequence,
250+
it is recommended to annotate explicitly with `@ModelAttribute` method parameters for such use case
251+
with GraalVM.

0 commit comments

Comments
 (0)