Standalone Web Client

I'm using HttpURLConnection to connect to a URL. I can connect and get the response code, all the HTML content, etc. But I'm unable to get the URL.

So let's say I post/submit using the URL http://www.mydomain.com/page1.jsp. Then my response comes back and the URL is now www.mydomain.com/page2.jsp. I can get all the HTML that page2.jsp created, but I cannot get the URL itself.

I need to programmatically get the response URL, as it may have directed me to page3.jsp, who knows. I'm having an IMPOSSIBLE time trying to get this working.

[562 byte] By [CarrieHunta] at [2007-11-26 16:07:35]
# 1
If a HTTP response is a redirect, it will add a header in the response.So to retrieve the new location invokeHttpURLConnectioncon.getHeaderField("location")
Tiom_a at 2007-7-8 22:29:53 > top of Java-index,Desktop,Developing for the Desktop...