title: display raw xml in popup window using java when a link is clicked
body: <p>I am using Struts 1.x and jsp as view to display. 
  Want to display the entire xml file as it is in a new pop-up window when a link is clicked in jsp. So far I have managed to open the pop-up window but I get a blank window and save/open/cancel links in browser(IE9). When clicking on save I get as 'url.do' but I just want to display the xml content as it is in browser, just don't want to save.</p>
  
  <p>Here is what I wrote in javascript function</p>
  
  <pre><code>function viewXML(bcFileNo){
  popupwin = window.open("about:blank", "popupwin", "toolbar=no, resizable=yes, menubar=no, scrollbars=yes, status=no, location=no, width=900 , height=400");
  var form = document.forms['BirthCertificateForm'];
  form.action = "/Vista-Web/birthCertificateOverview.do?method=viewBirthCertificateDetails&amp;bCertFileNo="+bcFileNo;
  form.target = "popupwin";
  form.submit();
  form.target = "_self";
  }
  </code></pre>
  
  <p>Here is what I wrote in Action class</p>
  
  <pre><code>String xmlContent = getXMLContent();
  byte[] birthCertBytes = xmlContent.getBytes();
  // set xml content
  response.setContentType("html/xml");
  // write the content to the output stream
  BufferedOutputStream outStream = new BufferedOutputStream(response.getOutputStream());
  outStream.write(birthCertBytes);
  outStream.flush();
  outStream.close();
  </code></pre>