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 Java 8 in Action this week in the Java 8 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
Author

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
Greenhorn

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, Salesforce.com, San Francisco, CA, USA.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can sendError be called after flush()??
 
Similar Threads
sendError and IllegalStateException
Please answer these few doubts
doubt in Exception occured by sendError()
sendRedirect ( qsn from Study kit)
Confused with flush() behavior