This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ Mock Exam question on error-page tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ Mock Exam question on error-page tag" Watch "HFSJ Mock Exam question on error-page tag" New topic
Author

HFSJ Mock Exam question on error-page tag

Tyronne Fernando
Ranch Hand

Joined: May 11, 2008
Posts: 50
The following question is the number 54 question on HFSJ Mock Exam:

Given a portion of Java EE web application�s deployment descriptor:

62. <error-page>
63. <exception-type>IOException</exception-type>
64. <location>/mainError.jsp</location>
65. </error-page>
66. <error-page>
67. <error-code>404</error-code>
68. <location>/notFound.jsp</location>
69. </error-page>

A. The deployment descriptor is not valid.
B. If the application throws an IOException, nothing will be served.
C. If the application throws an IOException, notFound.jsp will be served.
D. If the application throws an IOException, mainError.jsp will be served.

The correct answers are given in the book are: A

Isn't B is correct as well? Because the DD is not valid, when an IOException is thrown nothing (mainError.jsp or notFound.jsp) will be served.

I couldn't find any correction on http://oreilly.com/catalog/9780596516680/errata/9780596516680.0708

Like to know what others think about this question as well. Thanks.
Surajsingh Thakur
Ranch Hand

Joined: Sep 09, 2008
Posts: 124

Yes the answer A is Correct because...
<exception-type>SHOULDBEAFULLIQUALIFIEDNAME</exception-type>

So in your case it should be

<exception-type>java.io.IOException</exception-type>




BE (Computer Science) SCJP 4 (80%) SCWCD 5 (97%) IBM CAD(98%) IBM CAppD(100%) IBM SD(100%)
Tyronne Fernando
Ranch Hand

Joined: May 11, 2008
Posts: 50
So, in this case answer B is correct as well? Is that correct.

Because the exception is not mapped properly.
Justin Rundle
Ranch Hand

Joined: Mar 26, 2008
Posts: 123

In my opinion the only correct anwser is A. In the statement:

"B. If the application throws an IOException, nothing will be served."

The key words are "nothing will be served", to me the standard Tomcat error page will be displayed, so this is something, therefore for me the anwser does not include B.

Not sure, what does everyone else think?
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Yes. the correct answer is optiopn A. Given that the configuration is invalid, the error thrown by the container will still propagate to the client. So, the statement that nothing will be served is not correct, I think.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HFSJ Mock Exam question on error-page tag
 
Similar Threads
Question from HF second edition
HFSJ Chapter 10 question doubt
HFSJ Mock Exam
HFSJ 2nd edition - Final Mock Exam incorrect answers!?
Final Mock exam question