File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes ServletResponse.isCommitted() 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 "ServletResponse.isCommitted()" Watch "ServletResponse.isCommitted()" New topic
Author

ServletResponse.isCommitted()

Tom Adams
Ranch Hand

Joined: Feb 07, 2003
Posts: 56
Several methods etc. throw a IllegalStateException if a response is already committed....
What causes the response to be committed? I know it happens once the response header has been sent to the browser but at what point does this occur?


Tom
Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
According to Servlet API, method flushBuffer() in class ServletResponse will commit the response and force any content in the buffer to be written to the client..
daniel
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3254
    
    2
Originally posted by Tom Adams:
Several methods etc. throw a IllegalStateException if a response is already committed....
What causes the response to be committed? I know it happens once the response header has been sent to the browser but at what point does this occur?

In practice, it might happen any time during the processing of the request. The container regularly flushes the buffer while the servlet is writing to the response. Since the headers are the first part of the response, they are the first ones to be flushed out and the response is committed.
Then, of course, there are methods that force the container to flush the buffer.


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServletResponse.isCommitted()
 
Similar Threads
When is a response committed
Please answer these few doubts
cannot forward after response has been committed
IllegalStateException
IllegalStateException