title: call a jasper PDF and show to the client or be able to download it?
body: <p>i uso DOJO + Spring MVC, i call to a ExportPDF.html that generates me my pdf 
  but as a result of my xhr function in my script, y have in the console caracthers like this @"x13&amp;"#%" i think that is my pdf. how can i display in a new web page or permit to the client download it?</p>
  
  <p>this is my exporPDF.html Controller</p>
  
  <pre><code>@RequestMapping(value = "/exportarPDF", method = {
          RequestMethod.GET, RequestMethod.POST })
  private @ResponseBody
  void exportarPDF(@ModelAttribute("someBean") somebean someBean,
          BindingResult result,HttpServletRequest request,HttpServletResponse response) throws Exception {
      response.setContentType("application/pdf");
      JasperReport mainReporte = (JasperReport) JRLoader.loadObject(mainJasper);
      JasperPrint mainPrint = JasperFillManager.fillReport(mainReporte, parameters, new JRBeanCollectionDataSource(SOMELIST));
  
   ServletOutputStream output = response.getOutputStream(); 
   JasperExportManager.exportReportToPdfStream(mainPrint, output);
   output.close();
  </code></pre>
  
  <p>}</p>
  
  <p>My pdf generate greats, but i can see in a page or download it, please help me</p>
  
  <p>and this is my script method</p>
  
  <pre><code>                xhr("exportarPDF.html", {
                      query : {
                          someValue: This Value is received well in the Spring Controller
                      },
                      handleAs : "json",
                      method : "post"
                  }).then(function(data) {
                      //I thinks this data is my pdf!
                  }, function(err) {
                      alert("Error Interno");
                  }, function(evt) {
                      // Handle a progress event from the request if the
                      // browser supports XHR2     
                  });
  </code></pre>
  
  <p>This is my debug with firebug</p>
  
  <p><img src="https://i.stack.imgur.com/hSE1o.png" alt="enter image description here"></p>