This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You can use class which act as session listener in your application and register it in deployment descriptor (web.xml) . It extends HttpSessionListener and implements method sessionCreated(HttpSessionEvent se) and sessionDestroyed(HttpSessionEvent se). You can put your code for clean up in method sessionDestroyed(). The web container will invoke or notify sessionDestroyed() when your application invalidates sessions or the sessions are timeout. Hope this help... Correct me if i am wrong... daniel [ April 02, 2003: Message edited by: Fisher Daniel ]
If you make your class that contains the data a SessionBindingListener, the object will be notified when the session is destroyed and you will have the data right there. You don't have to register a SessionBindingListener. Bill