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 response.isCommitted()??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "response.isCommitted()???" Watch "response.isCommitted()???" New topic
Author

response.isCommitted()???

Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323


the correct answer is 4.

refering to srvelet API
public boolean isCommitted()Returns a boolean indicating if the response has been committed. A committed response has already had its status code and headers written.

what are the status_code and headers for committed responce???

please help

Thanks
Poonam


Thanks <br />Poonam Agarwal SCWCD 86%
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9313
    
  17

Look every response has a status code (like 200 for OK etc) headers. So if headers are already sent to the client, then the response is said to have been committed. Headers are committed before the response content i.e. the HTML that we write. You can set the status code using reponse.setStatus() and set headers using response.addHeader and response.setHeader...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
Ok, thanks ankit
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: response.isCommitted()???