Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0.1
-
None
Description
For pages which are available per GET which uses <f:viewParam /> we often have the problem that @ViewAccessScoped is too aggressive in destroying beans if the >user opens the link in a new tab< (because the first request is done with the window-id of the first tab which causes the destroy of such beans >if< the navigation target is a different page. a custom js triggers a 2nd request with a new window-id to avoid cloning the window, but the first request already triggered the cleanup), but we still need to get new contextual instances once the GET parameters got changed.
By introducing a new @RestScoped and the respective Context implementation we can provide exactly that. A @RestScoped is a sub-context of @WindowScoped, thus every new browser tab will get a new contextual instance.
The RestScope is basically a CODI Conversation (1 bean == 1 conversation) very similar to @ViewAccessScoped. The only difference is that those 2 have different expiry calculation mechanism.