java.lang.IllegalStateException:Cannot forward after response has been committed异常出现的原因是因为
-
servlet.getServletContext().getRequestDispatcher("/DateUpdatePage.do").forward(request, response);
servlet.getServletContext().getRequestDispatcher("/DateUpdatePage.do").forward(request, response);
这个转发下面的必须要有一个return来返回,是不是必须用null,还没搞清楚
return null ;
这样写就没的问题了:
-
servlet.getServletContext().getRequestDispatcher("/DateUpdatePage.do").forward(request, response);
-
return null ;
servlet.getServletContext().getRequestDispatcher("/DateUpdatePage.do").forward(request, response);
return null ;
-------------------------------------------------------
下面为08.1.20修改
对于Cannot forward after response has been committedCannot forward after response has been committed这个错误,有了更加深刻的认识
这个是错误是由于response多次提交或者是由于有页面显示后仍然含请求转向产生的,就是说程序在return之前就已经执行了跳转或者执行过response,之后遇到return的话,程序想再次执行跳转,也就是重定向,这时功能也许会实现了,但是控制台会报错,所以控制好跳转是很重要的,我现在的解决办法还是加return null,还没找到更好的解决办法,return null就不能转到另外的页面,成功或失败,继续关注吧,我一定能找到可以跳转页面而又不报错的办法
分享到:
相关推荐
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
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 ...
NEW *-在侧面菜单中添加了Committed源代码的链接,以便任何有兴趣的人都可以参与! 更新3.0.2-您现在可以选择将待办事项存储在本地存储或Chrome存储中-漏洞修复更新3.0.1-创建待办事项列表-添加待办事项的链接-...
svn关键词BASE, HEAD, COMMITTED, PREV的深入理解.rar
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 ...