url = "http" + url.substring(4);
} else {
isGet = true;
addParameter(relay, url, encoding);
}
IMethod httpMethod = isGet ? new GetMethod(url) : new PostMethod(url);
// 设置客户端特殊的信息
httpMethod.setRequestHeader("If-None-Match", request
.getHeader("If-None-Match"));
httpMethod.setRequestHeader("If-Modified-Since", request
.getHeader("If-Modified-Since"));
// 取出服务器端可能用到的Cookie信息
Cookie[] cookies = request.getCookies();
if (cookies != null) {
StringBuilder s = new StringBuilder(64);
for (Cookie cookie : cookies) {
String name = cookie.getName();
if (!name.equals("JSESSIONID")) {
s.append(name).append('=').append(cookie.getValue()).append(';');
}
}
UserInformation info = relay.getUserInformation(false);
if (info != null) {
Object o = info.getProperty(SESSION_COOKIE_KEY);
if (o != null) {
s.append(o);
}
}
int len = s.length();
if (len > 0) {
s.setLength(len - 1);
}
httpMethod.setRequestHeader("Cookie", s.toString());
}
HttpClient httpClient = new HttpClient();
httpClient.setAutoDecode(true);
try {
if (param != null) {