servlet getWriter() has already been called for this response

来源:互联网 发布:mysql注入语句大全 编辑:程序博客网 时间:2024/06/05 07:46
Servlet代码:OutputStream os = response.getOutputStream();response.setContentType("application/msexcel");response.setHeader("Content-disposition","attachment;   filename=Excel1.xls");报错:getWriter() has already been called for this response解决办法:response.reset();加入这句就搞定了
OutputStream os = response.getOutputStream();response.setContentType("application/msexcel");response.setHeader("Content-disposition","attachment;   filename=Excel1.xls");

0 0
原创粉丝点击