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.
Here is what I wrote in javascript function
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&bCertFileNo="+bcFileNo;
form.target = "popupwin";
form.submit();
form.target = "_self";
}
Here is what I wrote in Action class
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();