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

Reply via email to