From what I understand, ViewScoped beans only get destroyed when one of the following take place:
1) JSF sends a POST request to another page with something like a <h:commandLink...>
2) The number of open beans exceeds the maximum threshold setting (default of 15)
3) The user's session expires
Here is my confusion:
Does #1 mean that if a user navigates away from the page with a GET request, the bean will stay open, even if eventually a JSF POST happens in the same browser tab on another page? Or will all active @ViewScoped instances for that browser tab be destroyed once a JSF POST is sent regardless of which page the user is on?
Does #2 mean that a user can have 15 bean instances active for each @ViewScoped class? Or is it 15 bean instances regardless of class -- meaning I could have 5 instances of Class1, 5 instances of Class2, and 5 instances of Class3, and a new bean would destroy the oldest active bean?
For #3, if STATE_SAVING_METHOD is set to "client", will that have any implications in ViewScoped beans being destroyed? From what I remember, there needs to be a way to manually control session expiration if STATE_SAVING_METHOD is set to client.
Finally, is there a way to manage active ViewScoped beans so that they can be destroyed when a user clicks "logout" for instance?
@ViewScoped
works. – Scrutiny@ViewScoped
beans, I can't see any reason for doing such an operation if session removing guarantees they'll be deleted. – Hyson