G S Sundar wrote:
> "Christopher K. St. John" wrote:
> > Sam Newman wrote:
> > >
> > > Once you have your serialized object, simply store it in a
> > > file which both your servlets can access
> >
> > you might consider making an http call from the first
> > servlet to the second, and send the information in the
> > body of the request.
>
> If i make a call from Servlet1 to Servlet2 using
> "Response.sendRedirect(String urlString)".
>

 I'm assuming that the servlets are running in
different JVM's, right? If they're in the same
JVM, there are better ways.

 But anyway.

 I meant you should have code in Servlet1 that calls
Servlet2 using a URLConnection, and sends the data
in the body of a POST. There's code in the networking
part of the Java Tutorial[1] that shows how to do a
POST from Java. You can either serialize up some
Java objects, or just send text.

 Not very pretty, but it should work. You might also
consider something like JMS or JavaSpaces[2].


[1] The Java Tutorial is available at:
   http://java.sun.com/docs/books/tutorial/?frontpage-spotlight
 The relevant part of the networking trail:
   http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html

[2] Rummage around on the java.sun.com "Products
 and API's" page for details.


--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to