This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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: 2372

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
Lead Member of Technical Staff,, San Francisco, CA, USA.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: can sendError be called after flush()??
It's not a secret anymore!