aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes can sendError be called after flush()?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "can sendError be called after flush()??" Watch "can sendError be called after flush()??" New topic

can sendError be called after flush()??

Ernest Lee
Ranch Hand

Joined: Aug 20, 2001
Posts: 145
what happens when we call sendError/setStatus after we called flush() on JSPWrite???

will flush() commits the response??
[This message has been edited by Ernest Lee (edited December 04, 2001).]
Fozan Zaidi

Joined: Dec 03, 2001
Posts: 18
When u call flush() response is commited so it is now too late to change status code or header fields of response.Well sendError/sendRedirect at this state will through illegalStateException where as setStatus/setHeader calls will simply be ignored
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

Well Ernest, setStatus() & setContentType() are the two methods that must be used b4 using any respone body....

Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!

Ashik Uzzaman
Senior Member of Technical Staff,, San Francisco, CA, USA.
I agree. Here's the link:
subject: can sendError be called after flush()??