• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HFSJ Mock Exam question on error-page tag

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 124
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 123
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic