Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

IllegalStateException does not happen. Why not?

Otto Teixeira
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

According to HFSJ, I should get an IllegalStateException if I redirect or dispatch the request after writing to the response. But that is not happening.

In any servlet's doPost():

No exceptions occur. The sendRedirect statement is simply ignored.
If I remove the flush() line, then it gets redirect but still without the exception.

What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!