Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IllegalStateException problem

 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Above is part of a code in a Servlet.
But I am not getting IllegalStateException in the line
writer.println("After Flush"); although I have committed the response
the line before.

Where am I going wrong?

Regards,
Joshua
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing prevents you from outputting after it has been flushed.
 
Tridib Samanta
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No method of PrintWriter class throws IllegalStateException. You will get IllegalStateException if you try to forward the request to other page after calling flush().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic