Hello Andras,
I think the way you want to solve this problem is not the best, because
you try to use the servlet class and it's methods (init) in a way that
was not intended by the servlet API.
The reload of a servlet is to my knowledge (and experience) not
specified in the servlet standard. So it depends on your servlet engine
how it handles the availability of a new servlet class.
Probably you should try a different approach, e. g. you could use a
singleton class that reads the text file and runs a separate thread that
looks for a new version of the text file after certain times. Your
servlets could then ask the singleton class for the headlines.
-Henning
Andras Balogh wrote:
>
> Hi,
>
> Here is my problem. We are having in a lot of our webpages headlines.
> This is achieved by calling from JavaScript a servlet let's say
> HeadingServlet.
> This servlet is very simple, it is reading something from a text file and
> passes
> it to the client on every request (in doGet).I thought that moving this
> text file
> reading in init method and read the content in a String ( very few lines)
> than
> on every request just pass this String. I think it would be faster like
> this.
> Once in a while (let's say once a day) we change this text file with an
> administrative
> servlet (AdminServlet). Now i would like to call somehow the HeadingServlet
> destroy
> and force reinitializing on next request.
> I even thought about modifying the HeadingServlet.class date time and
> the servlet engine
> (with autoreload classes option turned on) will reload it. However i found
> this option too tricky.
> If somebody has some answers please let me know.
> I am using Apache+Jserv so i use JSDK20.
>
> Thank You,
>
> Andras.
>
> ___________________________________________________________________________
> 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
begin:vcard
n:Brune;Henning
tel;fax:+49 (0)5 21/1 06-64 40
tel;work:+49 (0)5 21/1 06-29 48
x-mozilla-html:FALSE
org:Universitaet Bielefeld;Technische Fakultaet, AG TI
adr:;;Postfach 100131;Bielefeld;NRW;33501;Germany
version:2.1
email;internet:[EMAIL PROTECTED]
title:Dipl.-Inform.
fn:Henning Brune
end:vcard
S/MIME Cryptographic Signature