>>> Arun Jayaprakash <[EMAIL PROTECTED]> 08-Jan-01 11:40:43 AM >>>

>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.

Because you haven't written the init method correctly. You should
check things like that before asking a question.

You're missing the call to:

   super.init(config)

without that the call to config.getServletContext() won't work.


>Have I called the run() method correctly? If not, is
>there any other way to call this servlet every hour?

But the above doesn't matter coz this won't work anyway.

What will hapen is that when you call your servlet it will do the
first pass and then block for 30 minutes. It will then finish and not
run again until you request it again.

Read a basic intro to threads to understand how to set this up
properly (I think there's one on Sun's site if you look).


Nic Ferrier

___________________________________________________________________________
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