Hi I am using Head First
Servlets &
JSP 2nd Edition and given Final mock exam.
I am very much disappointed by the exam lots of errors I found and some of them are very Big mistakes, in order to confuse reader given very close answer which is good but some questions right answer is not selected .
Big mistakes ===============================================================
66. Question is given with two para and no options are there to select ???
Page 824
26. Answers given B,D seems by mistake because in comment of answer it self its written Answer A,B,D make list not empty.
So <c
therwise> will not execute So correct answer is C,E but checked wrong answer.
45. Assuming that �my.jsp� adds bytes 4,5,6 to response ,what is the result ?
A.123
B. 456
C.123456
D.456123
E.An Exception is thrown
Anser given : B.
The first mistake here is line no 15 is wrong it should be request.getRequestDispatcher();
Also If you correct this mistake and run this program in
tomcat its giving you IlleagalStateException .
Correct answer is E 49. Answer checked is against the comment given.
Here Line 3 is wrong because prefix jsp is reserved for standard actions. ( D should be answer)
69. Here we have two directories (directory 1, directory 2)and two members (Beginner,EXPERT). And inside Security-constraint only http-method is given which is �GET�. Now we want to restrict BEGINNER to access directory 2.
Anser Given (D)
As per answer given is to put directory 2 url and role tag BEGINNER.
Which is equivalent to :
It means BEGINNER only can access directory2. ( Which is completely against the question asked which want to restrict BEGINNER to access directory2�s resources)
As per me answer is C. ===============================================================
Small mistakes
===============================================================
6. Answer C : The DD tag used to declare them is : <listner> is also true�.
14. Anser B :
Java EE containers must support URL rewriting is also true .
Comments given with the answer � URL rewriting is almost used as fallback when cookies are not available ,but its NOT a requirement for containers�
I feel its wrong even if it used as fallback container must support it�
54. I tried this example in tomcat even if you put <exception-type>IOException</exception-type> container not giving any validation error.
Anser given is A. is only ture if B is not given because if both are there correct answer is B. Which says If application throws an IOException ,nothing will be served.(Because in DD we didn�t give comple class name of IOExceptin.
60. D. Both (context parameter,servlet init parameter) can be directly accessed from a JSP
Here option D is not given true.With Imlicit object application,config we can do that.
[ June 15, 2008: Message edited by: gopal venu ]