HttpState state = this.httpClient.getState();
// fill in the login form and submit it
PostMethod postMethod = new PostMethod(this.testAppBaseURL + "j_security_check");
postMethod.addRequestHeader("Referer", this.testAppBaseURL + "restricted/login.html");
postMethod.addParameter("j_username", "jduke");
postMethod.addParameter("j_password", "theduke");
Header location = null;
try
{
int responseCode = this.httpClient.executeMethod(postMethod.getHostConfiguration(), postMethod, state);
log.debug("responseCode=" + responseCode + ", response=" + postMethod.getStatusText());