WINDOW.OPEN PDF文件

public void reportPrint() throws Exception{
String root_path = ServletActionContext.getServletContext().getRealPath( "/" );
root_path = root_path.replace( "\","/");
String reportFilePath = root_path + "WEB-INF/reports/invoiceSeikyu.jasper" ;
JasperReport report = (JasperReport)JRLoader.loadObject(reportFilePath);
JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(seikyuList);

invoiceReport.setSeikyuDetailList(ds);
invoiceReportList.add(invoiceReport);
JRDataSource dataSource = new JRBeanCollectionDataSource(invoiceReportList);
JasperPrint jasperPrint = JasperFillManager.fillReport(report,map,dataSource);
JRPdfExporter exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
ActionContext ac=ActionContext.getContext();
HttpServletResponse response=(HttpServletResponse)ac.get(ServletActionContext.HTTP_RESPONSE);
response.setCharacterEncoding("utf-8");
response.setContentType("application/pdf");
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, response.getOutputStream());
exporter.exportReport();
}
如上所示STRUTS2中有一方法reportPrint、生成PDF报表、我用窗体SUBMIT方式可以打开一PDF WEB
现在的问题是
我想用$.AJAX方式提交参数、得到STRUTS2中的reportPrint方法返回值、然后用WINDOW.OPEN把返回值显示
出来、结果显示为乱码。
该怎样打开一个新窗口、把PDF显示在这个窗口中呢?
谢谢!

参数多的话用submit(),你的目的只是另外弹出一个窗口显示而已,不要把问题复杂化。
document.forms['formname'].action = "";
document.forms['formname'].target = "_blank";
document.forms['formname'].submit();

这个为什么要改用Ajax做呢?动机是什么呢?
你原来的做法也是新打开一个页面,换了Ajax还是一样的效果.

你的标题不都已经说了吗?
window.open("reportPrint.action");

你是说一个页面中既有PDF又有HTML???

window.open("reportPrint.action?p1=aaa&p2=bbb");
参数多的话,拼成一个字符串作为一个参数传递过去,然后再解析