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 也是报错无法导出  跪求大神啊