You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Randy Layman <ra...@aswethink.com> on 2002/02/21 15:30:56 UTC

RE: Forwarding requests to other Services?

	You could either use response.sendRedirect to the servlet or
jva.net.URLConnection to call the other servlet and then stream the output
from the servlet to your response.getOutputStream.

	Randy

> -----Original Message-----
> From: Scott Shorter [mailto:shorter@caradas.com]
> Sent: Thursday, February 21, 2002 10:09 AM
> To: 'Tomcat Users List'
> Subject: Forwarding requests to other Services?
> 
> 
> All,
> 
> I read in the API that the path to use as a parameter to
> ServletRequest.getRequestDispatcher(String path) cannot extend beyond
> the current context.  This is a problem, because I need to forward a
> request to a servlet that listens on a different port, and 
> hence is part
> of a different service and different context.
> 
> Can someone recommend a solution?
> 
> Thanks in advance,
> Scott
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: Forwarding requests to other Services?

Posted by Scott Shorter <sh...@caradas.com>.
I was afraid you would say that.  Bleah.

Of course the good news about that is I realized that the other servlet
then tries to forward back to the first after it's done its thing.  I'll
try redirects instead and see how that works.

Will the redirect maintain request attributes like forward will?

Thanks,
Scott

> -----Original Message-----
> From: Randy Layman [mailto:randy.layman@aswethink.com] 
> Sent: Thursday, February 21, 2002 9:31 AM
> To: 'Tomcat Users List'
> Subject: RE: Forwarding requests to other Services?
> 
> 
> 
> 	You could either use response.sendRedirect to the 
> servlet or jva.net.URLConnection to call the other servlet 
> and then stream the output from the servlet to your 
> response.getOutputStream.
> 
> 	Randy
> 
> > -----Original Message-----
> > From: Scott Shorter [mailto:shorter@caradas.com]
> > Sent: Thursday, February 21, 2002 10:09 AM
> > To: 'Tomcat Users List'
> > Subject: Forwarding requests to other Services?
> > 
> > 
> > All,
> > 
> > I read in the API that the path to use as a parameter to 
> > ServletRequest.getRequestDispatcher(String path) cannot 
> extend beyond 
> > the current context.  This is a problem, because I need to 
> forward a 
> > request to a servlet that listens on a different port, and hence is 
> > part of a different service and different context.
> > 
> > Can someone recommend a solution?
> > 
> > Thanks in advance,
> > Scott
> > 
> > 
> > --
> > To unsubscribe:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> > For 
> additional commands: 
> <ma...@jakarta.apache.org>
> > Troubles with the list: 
> <ma...@jakarta.apache.org>
> > 
> 
> --
> To 
> unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>