tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Naga Yerramsetti <>
Subject Re: Servlet Collaboration
Date Mon, 12 Jun 2000 16:27:59 GMT
Thanks for the response. I may not have explained well. My problem is this.

Consider this

Two servlets running  in different servlet contexts, ServletA in contextA and servletB in
in servletA if I have

SomeClassA objA = new SomeClassA();

and in SevletB can I get handle  to objA using :

SomeClassA aliasObjA = getServletContext.getContext(<<URI for SevleletA>>);

"Craig R. McClanahan" wrote:

> Naga Yerramsetti wrote:
> > Is it possible for a servlet to access servlet from another context.
> >
> What precisely do you mean by "access"?  If you mean "can I get a reference to a servlet
> in another context", the answer is no -- you cannot even get a reference to a servlet
instance in
> your own context.
> >
> > We have differenet servlets running different servlet contexts(for different virtual
> > We need to have a management servlet that can communicate with all these servlets
> >
> What you can do is use the class (or it's subclass,
> to make a request from one servlet to another, and then process
> response.  The details are in the JDK javadocs for these classes.  There are also examples
> using them in the Java Language Tutorial's networking trail
> <>.
> Craig McClanahan
> --------------------------------------------------------------------------
> To unsubscribe, email:
> For additional commmands, email:

View raw message