title: Show pdf in new tab doesnt work with jquery and spring mvc
body: <p>I want to show pdf in new tab after generated it, im using JQuery 1.12.3 and Spring MVC 4.</p>
  
  <p>When i clic to my link, i generate pdf and my ajax method show success but my pdf isnt showed in new tab, what i've forgot ?</p>
  
  <p>i've follewed this posts :</p>
  
  <p><a href="https://stackoverflow.com/questions/19625271/display-pdf-in-a-webpage">Display PDF in a webpage</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21870802/open-responseentity-pdf-in-new-browser-tab">Open ResponseEntity PDF in new browser tab</a></p>
  
  <p><a href="https://stackoverflow.com/questions/35480463/spring-display-pdf-file-in-browser-instead-of-downloading">Spring - display PDF-file in browser instead of downloading</a></p>
  
  <p>I've tried to remove <strong>ResponseBody</strong> annotation, but i've the same result</p>
  
  <p>Here is my code :</p>
  
  <p><strong>HTML :</strong></p>
  
  <pre><code>&lt;a id="3676274" class="bulletinLink" target="_blank" href="#"&gt;Bulletin du 2015-04-30&lt;/a&gt;
  </code></pre>
  
  <p><strong>JQuery :</strong></p>
  
  <pre><code>$(".bulletinLink").click(function(e){
      e.preventDefault();
      var id = $(this).attr('id');
  
      var oAjax;
      var sUrl = sUrlBase + '/generatePdf/'+id;
  
      oAjax = $.ajax({
              url: sUrl,
              type: 'GET',
              cache: false,
              data : '',
              async : false
      });
  
      oAjax.done(function(transport) {
          alert("success");
      });
      oAjax.fail(function(transport) {
          alert("fail");
      });
  });
  </code></pre>
  
  <p><strong>Java :</strong></p>
  
  <pre><code>@RequestMapping(value = "/generatePdf/{id}", method = RequestMethod.GET)
  @ResponseBody
  public final ResponseEntity&lt;byte[]&gt; generateWithResponseBody(@PathVariable("id") final int idBulletin
              ,final HttpServletRequest httpRequete, final HttpServletResponse httpReponse) throws ApplicationException
  {
  ...
  HttpHeaders headers = new HttpHeaders();
  headers.setContentType( MediaType.parseMediaType( "application/pdf" ) );
  String filename = "spring_tutorial.pdf";
  headers.setContentDispositionFormData( filename, filename );
  headers.setCacheControl("must-revalidate, post-check=0, pre-check=0");
  ResponseEntity&lt;byte[]&gt; response = new ResponseEntity&lt;byte[]&gt;(out.toByteArray(), headers, HttpStatus.OK);
  return response;
  }
  </code></pre>