tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Layman <randy.lay...@aswethink.com>
Subject RE: Init method of servlet called twice?
Date Wed, 06 Feb 2002 19:10:31 GMT

	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:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
> 

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message