In the answer to question 54 of HFJS, they claim that the below segment from a web.xml is not a valid deployment descriptor. Specifically they say "The deployment descriptor is not valid". The reason they give is "a fully qualified name must be used".
I disagree with them. I believe the sample above is absolutely a valid deployment descriptor. I have tested it in my own web.xml and my application loads and runs just fine.
I agree that it does not accomplish what the programmer probably intended, because he did not use the full class name for the exception. But it is not an INVALID deployment descriptor. I think this is a misuse of the term "valid".
I am interested in other opinions on the matter. It is not listed in the errata for the book as incorrect.
I am starting to become concerned because I have encountered about a half dozen sample questions in HFJS that use terminology that I disagree with, such as the above. Mostly I have just ignored it and moved on. But now I worry because these guys supposedly helped write the test. I am hoping their language is more exact on the actual test.
I agree with you. If you dont mention fully qualified name , container doesn't throw any error saying it is invalid. But if that exception occurs, the JSP mentioned in <location> tag is not shown. Probably the wordings need to be changed
I think that the question is assuming that java.io.IOException is the exception being thrown and caught by the declaration, hence why it says that it is invalid.
But lets say I'm a newb java programmer that doesn't know how to name my packages and classes, and I wrote an Exception whose fully qualified name is IOException, then the declaration would be valid. right?
Joined: Oct 13, 2008
Thanks for your replies. I'm glad to know I'm not alone.
By the way I just noticed I said "question 54 of HFJS" but I didn't say chapter or page. I meant the full simulation exam at the back of the book (don't have book with so can't say page but it's the very last chapter).
subject: disagreement with terminology in test question on error-page