导出excel

来源:互联网 发布:海康无网络视频怎么办 编辑:程序博客网 时间:2024/04/29 23:12
response.addHeader("Content-Disposition", "attachment;filename="+ new String(filename.getBytes()));  
           OutputStream os= new BufferedOutputStream(response.getOutputStream());  
           response.setContentType("application/vnd.ms-excel;charset=gb2312");  
           os.write(buffer);  //作为响应,发送给客户端
           os.flush();  
           os.close();  
利用response响应声称非字符响应
response 代表服务器对客户端的响应,
 
0 0
原创粉丝点击