HTTP Status 500 – Request processing failed; nested exception is java.lang.IllegalStateException: Cannot create a session after the response has been committed

HTTP Status 500 – Request processing failed; nested exception is java.lang.IllegalStateException: Cannot create a session after the response has been committed

 

从错误中可以看出,大体意思是我们在Response输出响应后才创建Session的,当response输出之后,创建session无法将sessionid传到客户端,所以会报这种错误。

 

解决办法:

在把操作session的语句提前到response输出语句之前就可以了。

发表评论