Hello All, I am trying to use HttpURLConnection class to do a POST from a servlet to an COMPLETELY OUTSIDE URL, an URL outside of my JVM and my Servlet Engine. The post parameter string haS characters like %2B, %2F, %0A, %3D to signify the ascii values for characters +, /, '\n', = respectively. After doing the HttpURLConnection post and when I look at the request parameter string in my re-directed servlet I don't see %2B, %2F, %0A etc but I see their values of +, /, '\n','=' etc. I think, the HttpURLConnection is doing some kind of URL Decoding or transformation behind the Scenes. Is there any way to solve this Problem?. Thanks, Sudharsan.
If you want to pass the control from one page to another, you can either forward to the other page, as described above, or redirect to the new page (using the sendRedirect() method of the implicit response object).
forward only works within the same JVM sendRedirect, you lose the parameters.
Joined: Jul 12, 2001
Hello William and Others, I was able to solve my problem. For some unknown reason, HttpUrlConnection is INDEED doing URL Decoding without being asked to do so. I tried to encode the received value in my re-directed servlet using URLEncoder and I was able to see the ORIGINAL VALUES of the POST parameters before the POST. I Thank you all for the quick reply to my problem and your valuable inputs. I really appreciate it. Sudharsan
subject: HttpURLConnection seems to be doing some level of URL Decoding.