This content has been marked as final. Show 5 replies
The code is a bit big and I keep getting scolded for posting long code. The code is present in the examples directory when you download httpclient. Its called ClientFormLogon. Its pretty simple actually, you first go to the address you want to log on using a get method request. Then you analyse the form on the webpage and make sure you simulate it exactly, by populating all the name value pairs.. Then call the post method with those name value pairs and voila you are logged in.
You might want to read this, it gives a thorough understanding of what httpclient is.
What did you mean by
su_penguin wrote:Actually another thought occured to me, instead of going to the applet page, why dont I simulate what the applet is doing and call the servlet that the applet calls. But I dont know the URL to that servlet! Any thought?
What limitations does the applet provide?
Edited by: Sethu.R on Jun 21, 2009 6:30 PM
>Wireshark or a high trace level in the Java Console might tell you that information.
Actually another thought occured to me, instead of going to the applet page, why dont I simulate what the applet is doing and call the servlet that the applet calls. But I dont know the URL to that servlet! Any thought?>
I tried doing the tracing thing.. Hell I downloaded the jars for that applet from the website, but it looks a bit like reinventing the wheel to me. The website already offers a lot, I would just like to supplement it rather than replace it. Isn't there a way I could invoke the browser after logging in?
The server is using cookies to track the session. Cant I somehow feed that to the browser?