tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bragg, Casey" <Casey.Br...@allegiancetelecom.com>
Subject FW: Forwarding POST to a different server
Date Wed, 22 Mar 2000 16:53:56 GMT
I see that this will allow me to deliver the POSTed data to the second URL,
but how to I do the forwarding?

Do I use the URLConnection to send the POSTed data and then do a
sendRedirect or something like that?

Thanks so much for the help!

... Casey

> -----Original Message-----
> From:	Chris Bruce [SMTP:chrisabruce@yahoo.com]
> Sent:	Tuesday, March 21, 2000 9:37 PM
> To:	tomcat-user@jakarta.apache.org
> Subject:	RE: Forwarding POST to a different server
> 
> 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
> 
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org

Mime
View raw message