• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Mock Exam question on error-page tag

 
Tyronne Fernando
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>


 
Tyronne Fernando
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, in this case answer B is correct as well? Is that correct.

Because the exception is not mapped properly.
 
Justin Rundle
Ranch Hand
Posts: 123
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic