From a78afd0ae695908ad2b6d767e66f69db42a2a6a5 Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Wed, 9 Apr 2025 17:01:29 +0300 Subject: [PATCH 1/2] Add note about Vaadin scoped beans and serialization --- articles/flow/integrations/cdi/contexts.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/articles/flow/integrations/cdi/contexts.adoc b/articles/flow/integrations/cdi/contexts.adoc index 100eeeabbb..bf8a5b53fe 100644 --- a/articles/flow/integrations/cdi/contexts.adoc +++ b/articles/flow/integrations/cdi/contexts.adoc @@ -281,4 +281,8 @@ Injected beans aren't preserved when they're `UIScoped`, but only when they're ` The `UI` instance itself isn't preserved, but routing components are preserved. Any bean tied to the `UI` instance with `UIScoped` is recreated. The preserved routing components are moved to the new `UI`. To preserve beans during a browser refresh, you need to use `@RouteScoped`, as shown earlier. +.Vaadin scoped bean need to be serializable +[NOTE] +The [classname]`BeanStore` is stored in the session. This means in case you persist sessions using some 3rd party tool, the beans needs to be serializable. + [discussion-id]`4AAFA7A1-CF85-42D6-A7F2-E0CB0DB70FD1` From e0256bf4ccaa7499be3191638bfc8e875bb714ae Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Wed, 9 Apr 2025 17:39:34 +0300 Subject: [PATCH 2/2] Update articles/flow/integrations/cdi/contexts.adoc Co-authored-by: Marco Collovati --- articles/flow/integrations/cdi/contexts.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/flow/integrations/cdi/contexts.adoc b/articles/flow/integrations/cdi/contexts.adoc index bf8a5b53fe..89ba523f58 100644 --- a/articles/flow/integrations/cdi/contexts.adoc +++ b/articles/flow/integrations/cdi/contexts.adoc @@ -283,6 +283,6 @@ The `UI` instance itself isn't preserved, but routing components are preserved. .Vaadin scoped bean need to be serializable [NOTE] -The [classname]`BeanStore` is stored in the session. This means in case you persist sessions using some 3rd party tool, the beans needs to be serializable. +Scoped bean instances are stored in the session. This means in case you persist sessions using some 3rd party tool, the beans needs to be serializable. [discussion-id]`4AAFA7A1-CF85-42D6-A7F2-E0CB0DB70FD1`