Sometimes my URL will redirect to a new page, so I want to get the URL of the new page.
Here is my code:
URL url = new URL(\"http://stackoverflow.com
actually we can use HttpClient, which we can set HttpClient.followRedirect(true) HttpClinent will handle the redirect things.