I\'m using Mojarra 2.2.4 on GlassFish 4 with Java 7.
As I understand from BalusC\'s answer to How and when is a @ViewScoped bean destroyed in JSF?, @ViewScoped beans
I was able to find a clean work-around by using the OmniFaces @ViewScoped annotation (org.omnifaces.cdi.ViewScoped
) instead of the standard @ViewScoped (javax.faces.view.ViewScoped
).
The OmniFaces ViewScoped correctly destroys the beans as soon as they expire.
See here for more details: http://showcase.omnifaces.org/cdi/ViewScoped