• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

EPractice Lab mock exam 1 question 47

 
Ranch Foreman
Posts: 1898
12
  • Mark post as helpful
  • send pies
  • 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
  • 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
Ranch Foreman
Posts: 1898
12
  • Mark post as helpful
  • send pies
  • 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.
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic