当前位置:编程学习 > JAVA >>

poi导出 ClientAbortException: java.io.IOException报错

js是这样写的:
window.location.href = contextPath+ "/trade/exportData/excelOrder.?EXT=1&ssubTime=" +Ext.getCmp("ssubTime_").getRawValue()
+"&esubTime="+Ext.getCmp("esubTime_").getRawValue();

java:
public String excelOrder(){
List<Object[]> list = new ArrayList();
try{
String startsubTime=request.getParameter("ssubTime");//起始时间
String endsubTime=request.getParameter("esubTime");//结束时间
if(startsubTime==""){
startsubTime=endsubTime;
}
if(endsubTime==""){
endsubTime=startsubTime;
}
String endsubTimeStr =endsubTime+" 23:59:59";
String startsubTimeStr =startsubTime+" 00:00:00";
list = this.exportDataFACADE.getOrderlist(startsubTimeStr,endsubTimeStr);
HSSFWorkbook workbook = this.exportDataFACADE.excelorder(list);
this.printOrderExcel(workbook, response);
System.out.println(111);
}catch (Exception e) {
e.printStackTrace();
}
return  null;
}
public void printOrderExcel(HSSFWorkbook workBook,HttpServletResponse response)throws Exception{
String str = "导出订单明细";
String date = StringUtil.getstrFdate(new Date(), "yyyy-MM-dd");
String title = str + date;
OutputStream opStream1 = response.getOutputStream();
try{
response.setHeader("Content-disposition", "attachment;filename="
+new String(title.getBytes("gbk"),"iso8859-1")+".xls");
response.setContentType("application/download");
workBook.write(opStream1);
}
finally {
opStream1.flush();
opStream1.close();
}
}

用ie9  火狐   google都没问题 用360 下载器下载会报错,但是到处成功了,用ie8 也是报错无法导出  跪求大神啊 --------------------编程问答-------------------- 大神们快来啊   --------------------编程问答-------------------- 你这用的是struts吧,struts导出文件下载時,配置action有多种方式,换一种试试,可能是兼容性问题 --------------------编程问答--------------------
引用 2 楼 hello28 的回复:
你这用的是struts吧,struts导出文件下载時,配置action有多种方式,换一种试试,可能是兼容性问题
   我试过很多种方法单都是报错  ..   不过谢谢啊  谢谢帮助 --------------------编程问答-------------------- 应该是js的兼容性问题吧!js这个东西真是弄死人ie6 ,ie8还不一样 既然!
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,