aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes IllegalStateException problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply 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: 14672
    
  11

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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: IllegalStateException problem
 
Similar Threads
how flush() method sends response?
commiting response...
new to sockets/networking
ResultsSet to XML
Can you write to output stream after forward?