import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;
String url = PROJECTName + "LoginServlet";
PostMethod post = new PostMethod(url);post.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
post.setRequestBody(new NameValuePair[] {
new NameValuePair("mode","10"),
new NameValuePair("workid","01"),
new NameValuePair("password","1234")
});
post.releaseConnection();
HttpClient httpClient = new HttpClient();
httpClient.getHostConfiguration().setHost(HOST, 8080, "http");
httpClient.executeMethod(post);
post.releaseConnection();