EPractice Labs Skill Evaluation Lab wants to measure number of concurrent sessions. The team decided to use Java EE listener to track the logged in sessions. The listener must be plugged into the application with the help of web.xml without touching any other code. Which of the following listener can be configured in the deployment descriptor to achieve the above requirement?
A. HttpSessionAttributeListener
B. HttpSessionActivationListener
C. HttpSessionBindingListener
D. All of the above
The answer is A.
Explanation:
HttpSessionAttributeListener interface can be implemented in order to get notifications of changes to the attribute lists of session within a web application.....
I think none of the above. What if there is no attribute added, replaced, removed in any of the sessions? The purpose is to count how many concurrent sessions. But if those sessions does not fire the events, we cannot track the number of sessions.