Code example for BasicHttpContext

0
	/** 
	 * 使用HttpClient取得内容. 
	 */ 
	private HttpEntity fetchContent(String targetUrl) {
		HttpGet httpGet = new HttpGet(targetUrl);
		HttpContext context = new BasicHttpContext();
		try { 
			HttpResponse remoteResponse = httpClient.execute(httpGet, context);
			return remoteResponse.getEntity();
		} catch (Exception e) {
			logger.error("fetch remote content" + targetUrl + "  error", e);
			httpGet.abort();
			return null; 
		} 
	} 
 
	/** 
	 * 创建多线程安全的HttpClient实例. 
	 */ 
	@Override 
	public void init() throws ServletException {