Well, you could (rather easily) create a 'proxy' servlet.
The servlet makes a URLConnection to the exernal page and passes the
resulting data back to the original request.
In this case, you can use forward(ServletRequest, ServletResponse) to
redirect to the servlet.

Get the idea?

Geert Van Damme

> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Fei Li
> Sent: dinsdag 3 april 2001 4:14
> To: [EMAIL PROTECTED]
> Subject: Re: Forwarding / Redirecting to external pages.
>
>
> Actually you need forward() but I do not know why you hang on
> sendRedirect()
> that is used to tell user the page location is changed.
>
> Use the following that works for both POST and GET and any.
>
> forward(ServletRequest, ServletResponse) - Method in interface
> javax.servlet.RequestDispatcher
> Forwards a request from a servlet to another resource (servlet,
> JSP file, or
> HTML file) on the server.
>
> forward(String) - Method in class javax.servlet.jsp.PageContext
> This method is used to re-direct, or "forward" the current ServletRequest
> and ServletResponse to another active component in the application
>
> Fei Li
>
> -----Original Message-----
> From: Roy Truelove [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 02, 2001 6:10 PM
> To: [EMAIL PROTECTED]
> Subject: Forwarding / Redirecting to external pages.
>
>
> Hey everyone,
>
>     I've done my research, and I've come up with the following conclusion
> (I'm hoping someone will tell me that I'm wrong!).  It is not possible to
> redirect to an external page using a POST request.  Here's what
> makes me say
> this.  The HttpServletResponse.sendRedirect() method can only
> sent via a GET
> request, and can only use URL-encoded parameters.  If the resource your
> sending the request to expects POST parameters, then this is no good.  The
> only other way is to use a RequestDispatcher, but this also
> *might* not be a
> POST request, and cannot be used for external resources, depending on its
> implimentation.
>
> Any ideas?  Given the HTTP protocol, is it even possible to make a browser
> do this?
>
> Much thanks in advance,
>
> Roy Truelove
> pulver.com
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to