This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes IllegalStateException problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "IllegalStateException problem" Watch "IllegalStateException problem" New topic
Author

IllegalStateException problem

Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254


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


SCJP,SCWCD, Into ATG now!
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Nothing prevents you from outputting after it has been flushed.


[My Blog]
All roads lead to JavaRanch
Tridib Samanta
Ranch Hand

Joined: Apr 28, 2004
Posts: 128
No method of PrintWriter class throws IllegalStateException. You will get IllegalStateException if you try to forward the request to other page after calling flush().


Thanks, Tridib
SCJP 1.4, SCWCD 1.4, SCBCD 5.0
 
Don't get me started about those stupid light bulbs.
 
subject: IllegalStateException problem
 
It's not a secret anymore!