Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 1577 invoked from network); 12 Jun 2000 16:45:48 -0000 Received: from unknown (HELO dotmail01.dot.state.oh.us) (156.63.133.14) by locus.apache.org with SMTP; 12 Jun 2000 16:45:48 -0000 Received: from itccd310 ([192.168.1.99]) by dotmail01.dot.state.oh.us (Lotus Domino Release 5.0.2c) with SMTP id 2000061212454458:9685 ; Mon, 12 Jun 2000 12:45:44 -0400 Message-ID: <005e01bfd48d$c9db4150$6e14730a@dot.state.oh.us> From: "James Cook" To: References: <24300000001> <39450F8E.6D8B8622@tems.com> Subject: Re: Servlet Collaboration Date: Mon, 12 Jun 2000 12:46:43 -0400 MIME-Version: 1.0 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-MIMETrack: Itemize by SMTP Server on DOTMAIL01/ODOT(Release 5.0.2c |February 2, 2000) at 06/12/2000 12:45:44 PM, Serialize by Router on DOTMAIL01/ODOT(Release 5.0.2c |February 2, 2000) at 06/12/2000 12:45:47 PM, Serialize complete at 06/12/2000 12:45:47 PM Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Naga, You cannot pass objects between servlet contexts. There may be a kludgey way for you to attempt this, such as a shared file or shared memory, but it is highly non-portable. You may also be able to serialize the object as a string from one context to the other, but it would have to take place as a normal HTTP call. jim ----- Original Message ----- From: Naga Yerramsetti To: Sent: Monday, June 12, 2000 12:27 PM Subject: Re: Servlet Collaboration > 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 > contextB. > in servletA if I have > > > SomeClassA objA = new SomeClassA(); > getServleteContext().setAttribute("attribute1",objA); > > and in SevletB can I get handle to objA using : > > SomeClassA aliasObjA = getServletContext.getContext(<>); > > "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 instance > > 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 domains). > > > We need to have a management servlet that can communicate with all these servlets > > > > > > > What you can do is use the java.net.URLConnection class (or it's subclass, > > java.net.HttpURLConnection) to make a request from one servlet to another, and then process the > > response. The details are in the JDK javadocs for these classes. There are also examples of > > using them in the Java Language Tutorial's networking trail > > . > > > > Craig McClanahan > > > > -------------------------------------------------------------------------- > > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org > > For additional commmands, email: tomcat-user-help@jakarta.apache.org > > > -------------------------------------------------------------------------- > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org > For additional commmands, email: tomcat-user-help@jakarta.apache.org > >