把response的输出类型设置成 response.setContentType("application/x-download response.addHeader("Content-Disposition","attachment;filename=myexcel.xls" ); POI结果直接给response的输出流,就可以了