Notes below :
> 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
I apologize for not making this more clear in my previous message.. I'm
trying to send the request to a page that's not in my application.. it's a
CGI script that accepts only POST data, and sits on another server. I've
been looking into ways of using an HttpURLConnection, connecting to the
resource with a POST method, and piping that into my response the same way a
RequestDispatcher does, but.. the implimentation details of that get a
little tricky. It certainly would be a handy utility though.
Thanks,
Roy
>
> 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