I am trying to connect a web page through java code, using HttpURLConnection api, I am able to access its welcoe page. But this page is asking for username and password. Can any one tell me how I can login into the website through java code. The web page is using the post method to send request to the server.
What do you mean by "display" - does your Java application have a built-in browser to which you feed the HTML response which the server sends? [ August 17, 2006: Message edited by: Ulf Dittmer ]
No Actually after the login i am trying to see the next page by giving the next link in the url, and trying to read InputStream from the HTTPUrlConnection object instance. But empty string is coming.
Maybe the web app set a cookie to indicate that you are logged in, or requires some URL parameter you're not passing along?
Analysing the HTTP traffic that occurs if you login through a browser will help you determine what might be missing. A tool like the LiveHTTPHeaders extension for FireFox can help greatly with this.
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad: