webtier@glassfish.java.net

Re: _at_PreDestroy on a ViewScoped managed bean

From: <webtier_at_javadesktop.org>
Date: Mon, 05 Oct 2009 13:55:59 PDT

The view scope map is destroyed when something calls FacesContext.setViewRoot(root).

This will usually happen in the invoke application phase.

At that time, the properties map of the view is cleared, which is what causes @PreDestroy to be triggered. When the actual UIViewRoot object is destroyed turns out not to be important to this discussion (it's garbage collected at some point later).

(Thanks to Ed Burns for patiently explaining this to me.)
[Message sent by forum member 'driscoll' (jim.driscoll_at_sun.com)]

http://forums.java.net/jive/thread.jspa?messageID=366901