I am creating an application to send cXML documents using a HttpURLConnection. My problem is that a response document I receive contains a string url that I need to luanch in a browser. When I copy the url into my browser its get http 401 error. How can I luanch a browser from my java app. Is there any connection info in the response needed to luanch the browser ? Below is my code with the response.
That 401 means the server doesn't want to show you that page. Opening a new browser isn't likely to help. Are you able to navigate to the target page using a browser, maybe starting from a menu or logging in or something? The server may be looking for cookies or referrer in the header.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
On Windows the following command will launch the systems default browser. Not everyone uses IE. Put this in the command string cmd = "rundll32 url.dll,FileProtocolHandler " + url; //eg http://...' Runtime.getRuntime().exec(cmd);