tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "simon" <si...@lexues.co.jp>
Subject Re: on startup
Date Tue, 11 Sep 2001 04:53:42 GMT

----- Original Message ----- 
From: "Kamran Mazandrani" <kamranmz@netropolis.net>
To: <tomcat-user@jakarta.apache.org>
Sent: Tuesday, September 11, 2001 1:54 PM
Subject: Re: on startup


> Date: Fri, 7 Sep 2001 11:11:10 -0700 (PDT)
> From: "Craig R. McClanahan" <craigmcc@apache.org>
> Sender: <craigmcc@localhost>
> To: <tomcat-user@jakarta.apache.org>
> Subject: RE: How can I have a class run on start-up?
> 
> For a portable solution to the "run my class at startup" problem, Servlet
> 2.3 (and therefore Tomcat 4.0) supports a new API called
> javax.servlet.ServletContextListener. If you register such a listener in
> your web.xml file, the container will call the contextInitialized() method
> when the web application starts up, and contextDestroyed() when the web
> application is shut down.
> This is safer than the typical approach (use the init() method of a
> load-on-startup servlet), because the servlet specification does *not*
> guarantee to keep any particular servlet instance in memory for the life
> of the application (although Tomcat actually does so).
> Craig

Is this true?  Under what circumstances would a servlet be removed from memory?  

simon



Mime
View raw message