• Post Reply Bookmark Topic Watch Topic
  • New Topic

IllegalStateException problem  RSS feed

 
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
 
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.
 
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().
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!