title: How to interrupt the loading of a webpage?
body: <p>I know the title is a bit confusing. I will describe my task: </p>
  
  <p>Now I'm writing a webpage, which allow me to download some data or do some other stuff. The front end is jsp and the back end is java. So every time when I do something on this page(e.g. sort the data or download the data), a request will be sent to java and after data processing the .jsp page will be refreshed and loaded again(of cause after sorting it should be refreshed). But I just found that if I download a data with the following code, the refreshing will be interrupted:</p>
  
  <pre><code>OutputStream out = response.getOutputStream(); // response is HttpServletResponse
  doSomeOutput(out); // Just write something into OutputStream
  
  out.flush(); // **PAY ATTENTION**. The refreshing is interrupted here!
  out.close();
  </code></pre>
  
  <p>When I was debugging, the page was keeping loading until the third line. And then the page was not refreshed and the data was download.</p>
  
  <p>I hope you can understand what I'm talking about:(</p>
  
  <p>So now I have 2 questions: 1. How can I let the process keep working after out.flush();? 2. In my task I need the same behavior(the process is interrupted) in some other modules, but there's nothing to be download. So how can I interrupt the process besides out.flush();? </p>
  
  <p>Thank you guys!!</p>