Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
View not destroyed when closing browser tab on page backed by omnifaces @ViewScoped #208
I set the view/logical view limits to 3 and deployed a simple JSF page with omnifaces ViewScoped backing bean. Closing tabs does not appear to do anything. I would have expected the secondary beans to have been destroyed so that the first bean is never automatically expired.
I'm using GF 4.1, JSF 2.2, Omnifaces 2.2
Steps to reproduce:
javax.faces.application.ViewExpiredException: viewId:/viewBean.jsf - View /viewBean.jsf could not be restored.
changed the title from
View not destroyed when closing browser tab on page using @ViewScoped
View not destroyed when closing browser tab on page backed by omnifaces @ViewScoped
Feb 11, 2016
Reproduced. Nice find. Unfortunately, neither Mojarra nor MyFaces keeps server side view state "in sync" with PreDestroyViewMapEvent, so those server side view states still stick around. Your best bet is using client side state saving instead.
Theoretically, we could solve this by providing our own server side state manager, but this is not a trivial task. I'd rather first look how the JSF API itself can be improved with regard to this.