Not to be snide, but the answer to questions 1 & 2 are "it depends".
Depends on the servlet runner - this behavior isn't spec'd. You
shouldn't really rely on it behaving in any specific manner - RTFM for
your engine.
Questions 3 + 4 are answered in almost every book on servlets. init is
called by the server, like main is called by the VM. Init parameters
are passed in from the admin interface of the server.
Jim
"Srinivasan S (Systems Engineering Group)" wrote:
>
> Hello team,
>
> I have pasted these questions few days back but couldnt get any
> answer please someone pay attention to this stuff and clarify me.
>
> 1. If we reload an servlet it will take the latest compiled
> file from the servlet directory, i.e. it will check the timestamp and will
> reload the newly compile class file, but the servlets will hold reference
> to old objects as well, what will be the state of the old servlets
> will they refer to the newly compile file or it will be referring to the
> old ones. And what is the algorthim in cleaning up the old objects is
> there any time frame or else we need to force the GC to collect them?
>
> 2. Since the classloader for servlets will reload the latest
> version of the servlets can anyone explain me what will happen in the
> following scenario:
>
> (i). I have a A servlet which reads some file from the ini file
> that accompanies with the servlet, while it is in the process of reading
> and invoking the servlets i compiled a B(*new version of A*) servlet which
> will delete the ini file that exists and then will update some data into
> to the new file. Can anyone explain me what will the fate of the A
> servlet(*the original A servlet*)
>
> 3. What is the need of an init() method in a servlet since it
> initalizes all the parameters and save a reference of the ServletConfig,
> wont it not be good if another constructor of the doPost or doXXX() has a
> parameter of the servletconfig and save a reference. Is SERVLET following
> any naming convention??
>
> 4. What are initParameters and how are they passed to
> servlets??
>
> #-----------------------------------------------------------------------#
> # #
> # "ARISE AWAKE and stop not till the GOAL is reached" #
> # #
> # [EMAIL PROTECTED] #
> #-----------------------------------------------------------------------#
>
> ___________________________________________________________________________
> 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