yes using the SessionBindingListener interface is the most simple
and a good way to do this
May the Force be with you
> -----Original Message-----
> From: T Panton [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, January 08, 2001 5:50 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Can servlets implements the Runnable interface
>
> Arun Jayaprakash wrote:
> >
> > Hello,
> >
> > I have a servlet that traverses a hashtable that
> > contain user logins mapped to their session objects.
> > Every hour, I want this servlet to run and clear those
> > user logins whose session objects have not changed in
> > the last half hour. I wrote the following code, but I
> > config.getServletContext is returning a null object.
> > Have I called the run() method correctly? If not, is
> > there any other way to call this servlet every hour?
>
> No you haven't called run() correctly, not if you wanted it to run in
> a new thread.
>
> Take a look at http://www.westhawk.co.uk/nluug/nj96/practical.html
> for a simple example.
>
> However I'm guessing that you can get what you want without using
> threads.
> If you just want the hashtable cleaned up when sessions timeout (which
> they
> will if not used), you can just use the SessionBindingListener interface
> Which will be invoked at the 'correct' times by the servlet container.
>
> Tim.
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html