try { response.setContentType("application/x-msexcel");// response.addHeader("Content-Disposition","attachment;filename=" + URLEncoder.encode(filedisplay, "UTF-8")); RequestDispatcher dis = session.getServletContext().getRequestDispatcher("/report"+ "/"+ filedownload); if(dis!= null) { dis.forward(request,response); } response.flushBuffer(); } catch (IOException e) { log.error("IO异常,response回应失败"); } catch (ServletException e) { log.error("servlet异常,转发失败"); } 下载的部分,设置contentType和Header就可以了。然后转发地址回去。