Activiti导出模型文件xml(xml文件超过10K)

时间:2017-12-07 16:59:15   收藏:0   阅读:574

Activiti导出超过10K的xml文件时,response 要在获取输出流之前设置header格式

原代码为:

ByteArrayInputStream in = new ByteArrayInputStream(exportBytes);

IOUtils.copy(in, response.getOutputStream());

response.setHeader("Content-Disposition", "attachment; filename="+ filename);

response.flushBuffer();

修改后,代码为:

ByteArrayInputStream in = new ByteArrayInputStream(exportBytes);

response.setHeader("Content-Disposition", "attachment; filename="+ filename);

IOUtils.copy(in, response.getOutputStream());

response.flushBuffer();

原文:http://www.cnblogs.com/zhaoyuq/p/7999665.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!