Re: invalidate session after calling listeners

2005-08-29 Thread Franklin Phan
Hassan, How do I add an instance of the listener to each session? Can you please provide an example? I forgot to mention that I already have the following in the first JSP after the login is validated: jsp:useBean id=listener class=abcd.AbcdSessionListener scope=session / %

Re: invalidate session after calling listeners

2005-08-29 Thread Franklin Phan
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)

Re: invalidate session after calling listeners

2005-08-29 Thread Franklin Phan
Hassan, I have found the solution. I think that a big part of what you were saying was something that I was already doing but neglected to mention (i.e., having a line of code in the JSP to bind the listener object to the session using setAttribute). Your commenting out my two lines of code

Re: invalidate session after calling listeners

2005-08-29 Thread Hassan Schroeder
Franklin Phan wrote: I have found the solution. Cool. :-) What threw me off in the first place was the poor API documentation for HttpSessionBindingListener interface. It says for valueUnbound: Notifies the object that it is being unbound from a session and identifies the session. It

Re: invalidate session after calling listeners

2005-08-27 Thread Hassan Schroeder
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

invalidate session after calling listeners

2005-08-26 Thread Franklin Phan
Is there a way to set Tomcat to call listeners before invalidate() is called on a session? 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. I can't seem to find a way to do it. Apparently, invalidate() is

Re: invalidate session after calling listeners

2005-08-26 Thread Darek Czarkowski
You could implement HttpSessionBindingListener and define your own valueBound and valueUnbound methods. DarekC On Fri, 2005-08-26 at 13:08, Franklin Phan wrote: Is there a way to set Tomcat to call listeners before invalidate() is called on a session? I'm trying to code a method to clean up

Re: invalidate session after calling listeners

2005-08-26 Thread Franklin Phan
Darek, I've tried your suggestion. As I've said before: I need to access the Session object. This is what I have: package abcd; import java.io.*; import javax.servlet.http.*; public class AbcdSessionListener implements HttpSessionBindingListener { private String userId; public void