Hassan,
Also, I don't understand the difference between a "global" and a "non-global"
listener approach. Can you explain? Thanks.
Thanks.
Hassan Schroeder wrote:
Franklin Phan wrote:
I'm trying to code a method to clean up specifically named files
inside a working dir (in Windows XP) whenever the session times out.
Rather than a global listener approach, why not just add an instance
of your listener *to each session*? When the session ends and that
object receives the event, it still knows its attributes; from your
example:
public void valueUnbound(HttpSessionBindingEvent se) {
AbcdUtil util = new AbcdUtil();
/* -- neither of these is necessary, as userId is still defined
* HttpSession session = se.getSession();
* String userId = (String)session.getValue("userId");
*/
I use this approach to return items to stock from an abandoned (via
session timeout) shopping cart, for instance.
FWIW!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]