Paul - Thank you for your response. After posting this question, I took a look at RFC 2616 and found this:
10.3 Redirection 3xx This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request. The action required MAY be carried out by the user agent without interaction with the user if and only if the method used in the second request is GET or HEAD. My reading of that is that redirection with a POST can't be done. Am I reading it wrong? > If you really want to do a POST take a look at Jakarta HttpClient for a > start. > > http://jakarta.apache.org/commons/httpclient/3.0/index.html My situation is exactly this. I have provide an authentication step for users accessing a resource the university pays for. The university has a password and user name that should not be exposed to the end user. I have an authentication facility that I pass a URL (to a servlet) to be connected to once the end user is authenticated. What I would like is to be able to formulate a POST request in the servlet and then foward the end user to it. It sounds to me that you are suggesting that in the servlet I should open an HTTP connection to the resource and read out the resulting page as though it were the servlet's response. I'm going to try that, though I can imagine various things going wrong. Thanks again for the help; Garey Mills Library Systems Office UC Berkeley The brain is not where you think On Wed, 22 Jun 2005, Paul Copeland wrote: > Probably RequestDispacther.forward won't do what you want unless the > external URL is in the same ServletContext or at least on the same server. > > If you have control of the other end you might forward with a > java.net.HttpURLConnection and just write into the OutputStream on one > end and read on the other end with ServletRequest.getReader(). Or even > sending a serialized object... > > If you really want to do a POST take a look at Jakarta HttpClient for a > start. > > http://jakarta.apache.org/commons/httpclient/3.0/index.html > > Paul Copeland > JOT Servlets Web Component Framework > http://www.jotobjects.com > > >------------------------------ > > > >Date: Wed, 22 Jun 2005 10:19:28 +0800 > >From: Sreenath <[EMAIL PROTECTED]> > >Subject: Re: redirecting from a servlet to an exterior URL using a POST > > > >Hi Gary > > > > As long as u use requestDispacther.forward("")(Instead of redirect) , > >the URL won't be visible .rather ur servlet URL will be visible in the > >address bar . So as long as URL is not visible GET and POST shouldn $B!G (Bt > >make any difference until unless u r sending some multi-form data > > > > > > > >-----Original Message----- > >From: A mailing list for discussion about Sun Microsystem's Java Servlet > >API Technology. [mailto:[EMAIL PROTECTED] On Behalf Of > >Garey Mills > >Sent: 2005 $BG/ (B6 $B7n (B22 $BF| (B 0:21 > >To: SERVLET-INTEREST@JAVA.SUN.COM > >Subject: redirecting from a servlet to an exterior URL using a POST > > > >Hello - > > > > Once a servlet I am writing is accessed, I want to set the > >values > >on several parameters and then redirect to an exterior URL, sending > >along > >the parameters. But I do not want the parameters exposed, so putting > >them > >into the URL as a query string won't work, I need a POST. > > > > Has anybody done this? > > > >Garey Mills > >Library Systems Office > >UC Berkeley > > > > > > > > > > ___________________________________________________________________________ > 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