• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EPractice Lab mock exam 1 question 47

 
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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.
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well there is no answer for "none of the above" so you pick the best one available.
This question does make the assumption that some attribute is stored in the session at some point.


But given the requirement of "configure in web.xml", A is the only answer, because it is the only one of those listed that is configured there


 
Himai Minh
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Stefan,
Thanks.
So, there must be an assumption that some new attributes are added or some attributes are removed or replaced when there is a new session created.
 
I yam what I yam and that's all that I yam - the great philosopher Popeye. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic