If forward does not work, then use response.sendRedirect(). For more information, check out this article http://www.fawcette.com/javapro/2002_03/online/online_eprods/servlets_03_19/ default.asp
-----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED] Behalf Of John C Cartwright Sent: Saturday, May 31, 2003 1:53 AM To: [EMAIL PROTECTED] Subject: Re: forward request to URL outside current context Thanks for the suggestions. I originally tried the RequestDispatcher, but found that it assumed that the new URL was inside the current context. e.g.: RequestDispatcher dispatcher = request.getRequestDispatcher("http://www.google.com"); dispatcher.forward(request,response); throws this exception: The requested resource (/jcc/servlet/http:/www.google.com) is not available. Thanks again! -- john Milt Epstein wrote: > On Fri, 30 May 2003, Devang Shah wrote: > > >>I think forward() forwards request to the specified resource on the >>current server only. However you can use >>HttpServletResponse.redirect to redirect response to another >>server. You can also post to another URL from within HTML/JSP page. > > > Just to clarify, the question stated "outside the current *context*" > [emphasis added], not "outside the current server". I believe someone > posted an solution using RequestDispatcher -- I'm not 100% sure that > will work, but I think it will. Certainly easy to try. > > > >>-----Original Message----- >>From: A mailing list for discussion about Sun Microsystem's Java Servlet >>API Technology. [mailto:[EMAIL PROTECTED] Behalf Of John >>C Cartwright >>Sent: Friday, May 30, 2003 1:48 PM >>To: [EMAIL PROTECTED] >>Subject: [SERVLET-INTEREST] forward request to URL outside current >>context >> >> >>Hello All, >> >>is there a way that I can use the >>RequestDispatcher.forward(request,response) method to forward a request >>to an URL outside the current context? >> >>Thanks! >> >>-- john >> >>===================================================== >>John Cartwright >>Associate Scientist >>Geospatial Data Services Group >>CIRES, National Geophysical Data Center/NOAA >>(303) 497-6284 >>[EMAIL PROTECTED] >>===================================================== >> > > > Milt Epstein > Research Programmer > Integration and Software Engineering (ISE) > Campus Information Technologies and Educational Services (CITES) > University of Illinois at Urbana-Champaign (UIUC) > [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 > > -- ===================================================== John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/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 ___________________________________________________________________________ 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
