首页 > 代码库 > java.lang.IllegalStateException: Cannot forward after response has been committed

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

发送get或post请求时,抛出如下异常:

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

 

异常说明response被委派了两次。

解决办法:

 

将doGet方法中继承超类的方法屏蔽。

重载父类的方法,会抛出response已经被提交的异常。

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