private boolean sendURL(String url) {
boolean right = false;
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
try {
client.executeMethod(method);
right = true;
}catch (Exception e) {
log.error(e, e.fillInStackTrace());
right = false;
} finally {
method.releaseConnection();
}
return right;
}[@more@]
boolean right = false;
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
try {
client.executeMethod(method);
right = true;
}catch (Exception e) {
log.error(e, e.fillInStackTrace());
right = false;
} finally {
method.releaseConnection();
}
return right;
}[@more@]
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/750220/viewspace-914043/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/750220/viewspace-914043/