There is nothing which stops you to do a "new MyServlet()" inside the
servlet code. This "theoritically" creates a new instance of the servlet.
Although this instance will not be used by the servlet container to delegate
requests.

-----Original Message-----
From: Milt Epstein [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 8:08 PM
To: [EMAIL PROTECTED]
Subject: Re: destroy method


On Thu, 31 Jul 2003, Milt Epstein wrote:

> On Thu, 31 Jul 2003, Pradeep Kumar wrote:
>
> > Can someone tell me, when does the web container destroys the
> > servlet object?
> >
> > More specifically, are the servlet objects destroyed whenever the
> > container goes down? Or, is it that the container can destroy the
> > object and recreate it periodically.
>
> You can make no assumptions about when the container might
> destroy/re-create servlets, because it can do it anytime it wants.  As
> to whether servlets are destroyed when the container goes down, that
> probably depends on how it goes down -- if it's a clean shutdown, most
> likely all servlets will be destroyed, if it's a crash, probably not.
>
>
> > According to the specification, there must be one and only one
> > instance of a servlet.
>
> Unless you're using SingleThreadModel -- which you should be anyway.
[ ... ]

Whoops -- that should be "shouldn't be".

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES) University
of Illinois at Urbana-Champaign (UIUC) [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

Reply via email to