@PreDestroy never called on @ViewScoped [duplicate]

This is a known issue and unfortunately not trivial to solve without letting all the navigation take place through the view scoped bean in question. See also JSF-impl issue 1839. This does only not cover cases where the enduser changes the URL in browser address bar or closes the window/tab. Their @PreDestroy will also not be called when the session get destroyed. An enhancement request for the specification has however been posted to get the dangling views to destroy during session destroy anyway: JSF-spec issue 905.

Leave a Comment