各位高手好,我在通过HTTPClient访问一个URL,这个URL指向了一个PDF文件的网页,此URL和PDF文件的源路径为同一个,可以在打开后页面查看源文件看到。访问时,总也不能定位到正确的页面,拿到PDF的内容。哪位高手之前遇到过此问题,请帮忙解决一下,先谢谢了。下面是访问时的主要代码:
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpParams params = httpClient.getParams();  
String str = "";
String url = "https://register.epo.org/espacenet/application?documentId=EGUPGGXYDHEPLEI&appnumber=EP99440339&showPdfPage=all";
try {
   TrustManager easyTrustManager = new X509TrustManager() {
    public void checkClientTrusted(java.security.cert.X509Certificate[] x509Certificates, String s) throws java.security.cert.CertificateException {
  //To change body of implemented methods use File | Settings | File Templates.
}
 public void checkServerTrusted(java.security.cert.X509Certificate[] x509Certificates, String s) throws java.security.cert.CertificateException {
//To change body of implemented methods use File | Settings | File Templates.
}
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
 return new java.security.cert.X509Certificate[0]; //To change body of implemented methods use File | Settings| File Templates.
 }
 };

 SSLContext sslcontext = SSLContext.getInstance("TLS");
 sslcontext.init(null, new TrustManager[]{easyTrustManager}, null);
 SSLSocketFactory sf = new SSLSocketFactory(sslcontext);
 Scheme sch = new Scheme("https", sf, 443);
 httpClient.getConnectionManager().getSchemeRegistry().register(sch);
 HttpPost httpPost = new HttpPost(url);//url就是对应的action
 httpPost.setHeader( "Accept", "*/*" );
 httpPost.setHeader( "User-Agent", userAgent );
//设置参数
 List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
//nameValuePairs.add(new BasicNameValuePair(INFO, info));//参数和对应数据值
 httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs,HTTP.UTF_8));
//post到服务器端
 HttpResponse response = httpClient.execute(httpPost);
 HttpEntity entity = response.getEntity();
 System.out.println("------------------------"+response.getStatusLine());
 System.out.println("----------------------------------------");
 if (entity != null) {
   System.out.println("Response content length: " + entity.getContentLength());
 }
 String content = EntityUtils.toString(entity);
 System.out.println("~~~~~~~~~~~~"+entity.getContentEncoding());
 System.out.println("~~~~~~~~~~~~"+content);
 System.out.println("~~~~~~~~~~~~"+content.getBytes().length);