I tried forwarding my servlet to a jsp after flushing my response. I didnt get any IllegalStateException and just was able to see the output of the servlet and the jsp output is ignored
You don't see the exception in the browser... you can check the log file for the exception. All the output is sent to browser before the flush() statement, rendered and rest of the code after flush() is ignored even if you put RequestDispatcher. Hope this helps..