Using the post method allows you to skip the filling in of the username and password into the textboxes altogether.
When you normally login (via a browser) to a webpage, the sequence of events is something like this:
1. Go to url www.myurlhere.com
2. Fill in the login/password boxes
3. Press login
4. Browser sends a POST message containing the login/password you just filled in.
I'm suggesting you skip steps 2 and 3 since all you need is the output of those steps (which you already know) and just go straight to the POST message.
What you would do is something like this:
Create an http message to go to the url of your login page.
Set the message type to POST.
Add the login string (which will be formatted similar to &username=<username>&password=<password> but may have extra arguments (that's why I recommend an http debugger).
Send the message.
I've never actually done this in
Java, only Visual Basic, so I'm not sure what the classes to use in Java are.