请问下各位哥哥姐姐们Android通过HttpPost连接服务器端有几种方式?
我通过这种方式 为什么不能连接啊?服务器端用的serlet,报错说我Tocat Localhost 8080 被拒绝
 private void login(String username,String password){
     httpPost = new HttpPost(Uri.HttpCustomerUri);
if (params.size() != 0) {
params = new ArrayList<NameValuePair>();
} else {
params.add(new BasicNameValuePair(Uri.METHOD_NAME, Uri.LOGIN));
params.add(new BasicNameValuePair("username", username));
params.add(new BasicNameValuePair("password", password));
try {
httpPost.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
httpResponse = new DefaultHttpClient().execute(httpPost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
byte[] data = EntityUtils.toByteArray(httpResponse.getEntity());
ByteArrayInputStream bis = new ByteArrayInputStream(data);
DataInputStream dis = new DataInputStream(bis);
if (dis.readUTF().equals("notnull")) {
final Customers c = new Customers();
c.setCustomerid(dis.readInt());
c.setUsername(dis.readUTF());
c.setPassword(dis.readUTF());
c.setRealname(dis.readUTF());
c.setIdentify(dis.readUTF());
c.setSex(dis.readUTF());
c.setBirthday(dis.readUTF());
c.setCustomeraddress(dis.readUTF());
c.setCreditcard(dis.readUTF());
c.setEmail(dis.readUTF());
c.setTelephone(dis.readUTF());
c.setAddress(dis.readUTF());
c.setZip(dis.readUTF());
c.setRe(dis.readUTF());
final ProgressDialog pb = new ProgressDialog(this);
pb.setTitle("正在登陆");
pb.setMessage("请稍后...");
pb.show();
new Thread(){
public void run(){
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Intent intent =new Intent(LoginActivity.this, WelcomeActivity.class);
intent.putExtra("customerid", c.getCustomerid());
intent.putExtra("username", c.getUsername());
intent.putExtra("creditcard", c.getCreditcard());
startActivity(intent);
pb.dismiss();
}
}.start();

} else {
Dialog_Message = "用户名或密码不正确,请重新输入";
showDialog(DIALOG1);
}
dis.close();
bis.close();
}
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
Log.e(TAG, e.getMessage());
e.printStackTrace();
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
Log.e(TAG, e.getMessage());
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
Log.e(TAG, e.getMessage());
e.printStackTrace();
}
}
    }
   public final class Uri {
public static final String HttpUri="http://192.168.1.140:8080/myhibernate/servlet/";
public static final String HttpCustomerUri = HttpUri+"CustomersServlet";请大家帮帮忙 不知道问题出在哪?