tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Cathrow" <>
Subject RE: init() called twice
Date Wed, 03 May 2000 22:57:47 GMT
is init() being called twice because the servlets is failing to initialise
correctly - so is being reloaded.
Try putting a println in the destroy method

-----Original Message-----
From: Tom Oellrich []
Sent: 26 April 2000 16:27
Subject: init() called twice


I have a problem with a servlet's init() method. I have an InitServlet which
is loaded on startup of Tomcat (specified in web.xml). The InitServlet's
init() method basically instantiates a connection pool object and stores it
in the servlet context. I wanted to make sure that no user can call this
InitServlet by typing the URL /foo/servlet/InitServlet in the address field
of his browser. To check this, I included a println("Foo") in the init()
method. Now, my problem is that "Foo" is displayed both during startup of
Tomcat (as it should!) *and* later when I call InitServlet from the address
field of my browser. I thought, a servlet's init() method is only called
While I'm at it, does anybody know how I can protect a specific servlet from
being accessed directly?


1.000.000 DM gewinnen - kostenlos tippen -, 8MB Speicher, Verschluesselung -

To unsubscribe, email:
For additional commmands, email:

View raw message