tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bruce <chrisabr...@yahoo.com>
Subject RE: Forwarding POST to a different server
Date Wed, 22 Mar 2000 03:37:12 GMT
You can use a URLConnection.  Open a DataOutputStream to your second
Servlet and send the stream from ServletRequest.getInputStream()

I have never tried this, I am not sure if it will send the content type
or even if it is encoded, but you might need to set
URLConnection.setRequestProperty("Content-type",
"application/x-www-form-urlencoded")


I hope this can be of help.

Regards,

Chris Bruce

--- Scott Evans <SCOTTE@amdocs.com> wrote:
> Are you reading the POST data in the first servlet? I read somewhere
> that
> POST data may only be read once. Anybody know if this is true?
> 
> Scott
> 
> > ----------
> > From: 	Bragg, Casey[SMTP:Casey.Bragg@allegiancetelecom.com]
> > Reply To: 	tomcat-user@jakarta.apache.org
> > Sent: 	Wednesday, March 22, 2000 1:41 AM
> > To: 	tomcat-user@jakarta.apache.org
> > Subject: 	Forwarding POST to a different server
> > 
> > I need to have a servlet forward a POST to a URL on a different
> server
> > than
> > that which the POST originated from.
> > 
> > In other words...
> > 
> > POSTED data on server A -> servlet on server A -> forward to -> URL
> on
> > server B.
> > 
> > The sendRedirect forwards to the URL on server B, but the POSTed
> data is
> > gone.
> > The javax.servlet.forward command forwards the POSTed data but only
> to
> > URLs
> > on server A (the originating server).
> > 
> > Is there a solution (other than wait for the next version)?
> > 
> > Thanks to all!  You are very helpful!
> > 
> > Casey
> > 
> >
>
--------------------------------------------------------------------------
> > 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
> 
> 

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Mime
View raw message