This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes response commitment 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 "response commitment" Watch "response commitment" New topic
Author

response commitment

cyril vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
Dear all,
I would like to be sure. Manning book SCWCD Exam Study Kit, p.109
Question 2:

Answer to question is: Assuming that getNameFromDBSomeHow() returns null, it will throw an IllegalStateException while serving request because when sendError is called, response is supposed to be commited and nothing may be written to the response once it is commited.
Now, in errata page for this book, we can read for this question:
Remove the line:
out.flush()

That is because this instruction enforces response to be commited, right?
So an answer to a precedent thread about resposne commitment would be:
when you see out.flush(); as instruction, you may say that the response is commited and so that in any case, you may call response.sendRedirect().
Am I right for this point?
Thanks for your response,
Regards,
Cyril.


SCJP 1.4, SCWCD, SCBCD, IBM XML, IBM Websphere 285, IBM Websphere 287
cyril vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
Sorry, you should of course read at the end of the posr
so that in any case, you may NOT call response.sendRedirect() or response.sendError().
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: response commitment
 
Similar Threads
sendRedirect()
some questions on J2EE test
sendRedirect ( qsn from Study kit)
doubt in Exam Kit Book
sendError