java.lang.IllegalStateException: Cannot create a session after the response has been committed

柔情痞子 提交于 2019-11-28 02:26:15
Berin Loritsch

What's happening is the response stream has been closed. Either you already sent a redirect, or committed some other type of response. I recommend getting your session object before you perform any response, and save the response until there is nothing left to do with the HttpServletRequest or HttpServletResponse objects.

A good practice is to return from your Servlet right away after performing a redirect, that way you can avoid some of these problems.

I had this problem because of multiple tag <h:outputScript target="head">

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!