File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes sendError qn in j2eecertificate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "sendError qn in j2eecertificate" Watch "sendError qn in j2eecertificate" New topic

sendError qn in j2eecertificate

Sundar Murthi
Ranch Hand

Joined: Mar 05, 2004
Posts: 209
I am attended the following qn in j2eecertificate demo exam.
What is the answer for this qn.

Which of the following statements regarding the sendError response method are true? [Check all correct answers]

1. sendError accepts java.lang.Throwable as an argument.
2. sendError can throw java.lang.IllegalStateException.
3. sendError has the side effect of committing the response.
4. sendError is only used to set the return status code when there is no error.
5. sendError throws an java.lang.InvalidStateException if the response has already been committed.

the answer given is 2 3 how it is?
Nitish Bahadur
Ranch Hand

Joined: Aug 25, 2003
Posts: 118
Refer to the HttpServletResponse.sendError(...) documentation in the spec.

"If the response has already been committed, this method throws an Illegal-
StateException. After using this method, the response should be considered
to be committed and should not be written to."
It is sorta covered in the JavaRanch Style Guide.
subject: sendError qn in j2eecertificate
Similar Threads
j2eeCertificate Ques.
need help on question from j2eecertificate
J2eeCertificate ques
Question and answer from j2eecertificate.