You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Randy Layman <ra...@aswethink.com> on 2002/02/06 20:10:31 UTC

RE: Init method of servlet called twice?

	Craig posted a technical explanation of this about two weeks ago, so
search the archives for that, but the short version is that for every unique
address that your servlet responds to the init method will be called.
Having an alias for your servlet (so you can pass parameters) and using the
servlet invoker (i.e. /servlets/com.whatever) is the most common way of
having this happen.  To solve your problem you need to modify the web.xml
file so that your servlet is only referenced once.

	Randy


> -----Original Message-----
> From: Donie Kelly [mailto:donie.kelly@tecnomen.ie]
> Sent: Wednesday, February 06, 2002 2:42 PM
> To: 'Tomcat Users List'
> Subject: Init method of servlet called twice?
> 
> 
> Hi all
> 
> Can anybody tell me why the init method can be called twice 
> in a servlet. I
> am loading the servlet on startup and init is first called there.
> 
> The first request to the servlet then calls the same init 
> method again?
> Please help. I cannot init twice.
> 
> Thanks
> Donie
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>