init() is called when the servlet is instantiated.  If you have
<load-on-startup>1</load-on-startup> then it will get called when the web
app is (re)started.  Otherwise, it will get called when the first request
for it is made.  To answer you're a) or b) question, it is both a and b.

Tim


-----Original Message-----
From: Martin Grogan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 11, 2006 7:25 AM
To: Tomcat Users List
Subject: When is init() called?

Hi all,
I'm new to the list. I was trying to find out exactly when Tomcat will call
a servlets init() method.
Is it
    a) When tomcat is restarted or
    b) When I restart my web-app context from the Tomcat manager panel.
I ask because we run web-apps on a shared hosting server and don't have
control over when Tomcat gets restarted, but would need to re-init() our
servlets from time to time. We are running on Tomcat 5.5.7 Thanks, Martin

------------
Martin Grogan
Keizen Software

[EMAIL PROTECTED]
www.keizensoftware.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to