java.lang.IllegalStateException: Cannot (forward | sendRedirect | create session) after response has been committed

后端 未结 8 1258
南笙
南笙 2020-11-21 11:06

This method throws

java.lang.IllegalStateException: Cannot forward after response has been committed

and I am unable to spot th

8条回答
  •  南旧
    南旧 (楼主)
    2020-11-21 11:48

    even adding a return statement brings up this exception, for which only solution is this code:

    if(!response.isCommitted())
    // Place another redirection
    

提交回复
热议问题