title: open pdf file in new window using servlet
body: <p>I am generating a pdf file for gate pass from my web application through servlet. I want to open this newly generated pdf in new window/tab and user should come back to the application from servlet. How can i open pdf in new window/tab? I am generating pdf from itext api. My servlet code snippet is:</p>
  
  <pre><code>        response.setHeader("Expires", "0");
          response.setHeader("Cache-Control","must-revalidate, post-check=0,precheck=0");
          response.setHeader("Pragma", "public");
          response.setContentType("application/pdf");
          response.setContentLength(baos.size());
          OutputStream os = response.getOutputStream();
          baos.writeTo(os);
          os.flush();
          os.close(); 
  </code></pre>