tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Cathrow" <acath...@seagull.nl>
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 [mailto:toellrich@web.de]
Sent: 26 April 2000 16:27
To: tomcat-user@jakarta.apache.org
Subject: init() called twice


Hello

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
once?
While I'm at it, does anybody know how I can protect a specific servlet from
being accessed directly?

TIA
Tom

_______________________________________________________________________
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
IhrName@web.de, 8MB Speicher, Verschluesselung - http://freemail.web.de


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message