Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Exam Doubts

 
gopal venu
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Source: Examulator

Quiz : 2
Question 11:
Which of the following statements are true?
Choose at least one answer.
a. To be able to directly access a servlet the servlet-name must have a matching servlet-mapping Correct
b. The init-param tag may contain java code between its opening and closing brackets Incorrect
c. The welcome-file tag can mark a servlet as the default item that is returned from a url Correct
d. The welcome-file tag must point to a servlet called welcome Incorrect
e. The error-page tag must point to an html or JSP page, not a servlet Incorrect The error-page tag can point to any valid resource.

Answer Given: A,C
My Answer: E

Question: 21
Which of the following statements are true?
Choose at least one answer.
a. HttpServletResponseWrapper takes a constructor parameter of type HttpServletResponse Correct
b. Filters are called in the order they appear in the deployment descriptor Correct
c. Methods of the wrapper classes must not be overridden Incorrect
d. Filters are an example of the Intercepting Filter design patttern Correct
e. Filters can only be invoked on incoming requests, and not on a dispatcher forward or include Incorrect

Answer Given: A,B,D
My Answer: A,D
As <url-pattern> assoociated filter get higher priority than <servlet-name>
 
Dee Brown
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec states, "The location element contains the location of the resource in the web application". The spec does not appear to restrict the type of resource that is allowed in the location element, and since a servlet is a resource, a servlet should be allowed. Since we are concerned with what is valid for the exam, we have to go with what is documented in the spec.

The other questions/answers are more obvious and appear to be as you have indicated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic