java.lang.IllegalStateException:Cannot forward after response has been committed 异常
http://blog.csdn.net/fenglibing/article/details/4106564
原因是调用了两次response
response.setContentType("application/vnd.ms-excel");
response.setContentType("UTF-8");
response.setHeader("Content-Disposition", "attachment; filename=" + getFileName() + ".xls");
os = response.getOutputStream();
wb.write(os);
return null;//这里原来写的是return mapping.findForward(SUCCESS);,所以报了这个异常
public String getFileName() throws Exception {
StringBuffer fileName = new StringBuffer("文件名-");
Date date = Calendar.getInstance().getTime();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HHmmss");
fileName.append(sdf.format(date));
return new String(fileName.toString().getBytes("GBK"), "ISO-8859-1");
}
分享到:
相关推荐
NULL 博文链接:https://m635674608.iteye.com/blog/1510545
prerequisite patches in an unstable way, which has been updated to compute in a way that is compatible with "git patch-id --stable". * The "git log" command by default behaves as if the --mailmap ...
These dummy transactions get committed when everything is idle (after there has been some activity).
Response already committed 删除websphere时,直接删除安装目录下的文件,重新安装websphere时会提示websphere已安装,是否安装副本。 WebSphere应用更新问题 配置oracle jdbc连接时,控制台测试连接成功,但应用...
Section=ResponseHeader Detail=CR 后面必须是 LF The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF 主体意思是微软没有容忍不符合RFC 822...
开源项目-golang-go.zip,"eliminate GOMAXPROCS limit" has just been committed to the master branch.
55 Read Committed隔离级别是如何基于ReadView机制实现的?l.pdf
PostgreSQL offers three levels of transaction isolation: Read Committed
Number of committers has been determined by going through CVS logs from January 1st, 2004 to December 31st, 2004 and contributors by going through the list of contributions and problem reports. ...
FO承诺-CFT协议-范围证明(英语论文)
curl for windows10 x64 , version Version 7.56.1 (23 Oct 2017) Daniel Stenberg (23 Oct 2017) - RELEASE-NOTES: 7.56.1 ...- imap: if a FETCH response has no size, don't call write callback
NEW *-在侧面菜单中添加了Committed源代码的链接,以便任何有兴趣的人都可以参与! 更新3.0.2-您现在可以选择将待办事项存储在本地存储或Chrome存储中-漏洞修复更新3.0.1-创建待办事项列表-添加待办事项的链接-...
svn关键词BASE, HEAD, COMMITTED, PREV的深入理解.rar
released the first version of the XtraGrid Suite, our focus has been to deliver ground-breaking new capabilities for Visual Studio .NET®. With XtraGrid Suite v2, you have at your disposal a ...
Returns a boolean indicating whether the named response header has already been set. contextDestroyed(ServletContextEvent) - Method in interface javax.servlet.ServletContextListener Notification ...
Everybody in the industry is committed to AJAX. Everybody understands the impact of it. Everybody recognizes the enormous power that can be derived from its employment in real-world solutions. Very ...
If you attempt to access a reserved address that has not yet been committed (backed by memory or disk) you will cause an access violation. Committed Memory Committed pages are those pages that when ...