"Craig R. McClanahan" wrote:
>
> John Cartwright wrote:
>
> > Hello All,
> >
> > I would like to find a way to have my servlet call an arbitrary URL
> > (e.g. a cgi, servlet in another context, or even a URL on a different
> > host). I don't seem to be able to do this with:
> > rd = getServletContext().getRequestDispatcher(url);
> >
> > It will only let me forward to pages/servlets in the same context.
> >
> > I am using Tomcat 3.1, and would greatly appreciate any suggestions.
> >
>
> You can use HttpServletResponse.sendRedirect() for this. It sends a "redirect"
> response back to your browser, which will then link to the new URL that you pass as
> an argument -- which can be any URL on any server.
>
> NOTE: You (obviously) won't be able to share any request attributes or session
> attributes with the new URL since sendRedirect causes the browser to send a second
> request, and sessions are scoped to the same context just like RequestDispatchers
> are.
Craig,
thanks for your reply. Can I get the context of a webapp other than the
one in which my servlet is running? If I'm using Apache to serve up
JSP/Servlets from Tomcat, where does CGI come into the picture? Does it
fall into any contect from Tomcat's perspective?
Thanks again for the help!
-- john
===============================================================================
John Cartwright
Professional Research Assistant / Associate Scientist
CIRES, SEG/NGDC/NOAA
(303) 497-6284
[EMAIL PROTECTED]
===============================================================================
___________________________________________________________________________
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