title: Java http client - get page content after refresh from javascript
body: <p>there are a lot of examples how to read url page content with java client.
  For example here is with apache http client ( <a href="http://hc.apache.org/httpclient-legacy/tutorial.html" rel="nofollow">http://hc.apache.org/httpclient-legacy/tutorial.html</a>)</p>
  
  <pre><code>HttpClient client = new HttpClient();
  GetMethod method = new GetMethod(url);
  int statusCode = client.executeMethod(method);
  if (statusCode != HttpStatus.SC_OK) {
     System.err.println("Method failed: " + method.getStatusLine());
  }
  byte[] responseBody = method.getResponseBody();
  </code></pre>
  
  <p>Here is my question:
  In page url can be redirect to other url after some time.
  For example in url www.mysite.com/xxx there is redirect after 5sec from javascript to url www.mysite.com/realpage/xxx, but you can not go directly to www.mysite.com/real-page/xxx, only with redirect. </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function go() {
          document.location.href = "http://www.mysite.com/realpage/xxx";
      }
  window.setTimeout("go()",5000);
  &lt;/script&gt;
  </code></pre>
  
  <p>How to do get this redirect in java client, and how to get content of this page in java client ?
  Tnx !</p>