• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EPractice Lab mock exam 4 question 50

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Which of the following statements are true about servlet 3.0?
a. listeners are invoked in a random order.
b. the order in which listeners are invoked can be defined.
c. order can be specified in web.xml or annotation
Given answer: b, c
Prior to this release of the specification, listeners were invoked in a random order. As of servlet 3.0, the order in which listeners are invoked can be defined.


I think the answers should be a , b.
For a, if the listeners are specified by annotation, the order is not specified.

Chapter 8.2.3 of Servlet 3.0, when using annotations to define the listeners, servlets and filters, the order in which they are invoked is unspecified.

For b, the order of the listeners are defined in web.xml.
For c, order cannot be specified by annotation.
So, c is incorrect.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2534
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bad question.

C is definitely incorrect, and B is correct. A is only correct if annotations are used; in this problem statement we are not sure so we can't give a correct answer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic