tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <bimargul...@gmail.com>
Subject Embedded tomcat contexts confusion
Date Thu, 09 Jun 2011 12:51:02 GMT
I'm using tomcat 7.0.14.

I create a org.apache.catalina.startup.Tomcat;.

I call 'addWebapp'

 lshContext = tomcat.addWebapp("/lsh", docBase.getCanonicalPath());.

The webapp in question has a Listener. The listener happens to belong to Spring.

contextInitialized has a try/catch block. In the catch, it call:

servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
ex);

and then rethrows the exception.

Out in my application, I am trying to find that attribute value. If I
ask lshContext (the context returned by addWebapp) for
servletContext(), I get a *different* object that has no attributes.

How can I navigate from the Context returned from addWebapp to the
context passed into the Listener?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message