Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Finding Redirect Location

843842Sep 18 2008 — edited Sep 22 2008
I'm writing an application that fetches a web page and changes the links of the page so that it goes through a proxy to clean up the page to be formatted for cell phones. Everything is working except when I encounter a site that redirects me to a local domain. ie If I go to http://bob.com and bob.com redirects me to http://bob.com/mobile how can I get the "/mobile" to store in a variable.

The application returns the page so there has to be some type of mechanism to get that redirect. I am using apaches HttpClient to make my connection. When I use getHost() it just returns the domain name. Anybody know how to solve this? Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2008
Added on Sep 18 2008
4 comments
205 views