Howdy,
I'm a bit confused.  Typically, one web app is one context and vice
versa.  Are you trying to define multiple web-apps per context?

The ServletContextListener will get messages when a context is
initialized or destroyed.  So you will get two messages per context for
the life of the server.  I assume you defined your listener in your
web.xml?  If so, you should only get one message (the
contextInitialized() one) when your context is started up.  

The parameter to the ServletContextListener events is a
ServletContextEvent.  You can call getServletContext() on this, and then
getServletContextName() will return the context's name.


>I have a webapp that i want to load when tomcat starts. I want to make
>sure the webapp only starts for one webapp and not the others.

I don't understand the 2nd sentence above.  Would it be better for your
needs to abandon the context listener approach in favor of a
<load-on-startup> servlet in the webapp you want to load on startup, and
do whatever you need in that servlet's init() method?

Yoav Shapira
Millennium ChemInformatics



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

Reply via email to