2017年11月30日 星期四

QUESTION 109

When using the @WebListener annotation, the class on which the annotation is applied to must also implement
at least one o the following interfaces (Choose two):

A. RequestListener
B. AttributeListener
C. ServletContextListener
D. HttpSessionListener
E. SessionAttributeListener
F. AsyncListener

Correct Answer: CD
Explanation/Reference:
@WebListener
The main task of the listener is to listen the particular events and process your own task on that event. For
example, if you want to initialize a database connection before your application starts, ServletContextListener
will be implemented to do that. Another good example is -when you want to do some task on the creation and
destruction of a session. For this purpose you need to implement HttpSessionListener.

沒有留言:

張貼留言