I figured out why I was getting null back from SERVLETCONTEXT.getServletContextName(), my web.xml file didn't have the <display-name>name</display-name> defined. Now that I have it in there, I see the event fired twice for my webapp.
Is that a bug? From what I can tell, it is creating the webapp twice. If I print out event.getSource() the objects are different. Can someone verify if this is a bug? peter lin peter lin wrote: > > Does anyone know how to get the webapp name from ServletContext? Here > is a quick description of what i am trying to do. > > 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 wrote a test class that implements > javax.servlet.ServletContextListener. What I'm seeing is the event is > fired twice and therefore loading the app twice. It seems a bit weird > to have the event fire twice. My test Listener checks to make sure the > app isn't already in the ServletContext before creating it. I have the > root path set to specific path in server.xml. > > thanks in advance. > > peter lin > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>