This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Why is this only specific to sessions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Why is this only specific to sessions?" Watch "Why is this only specific to sessions?" New topic
Author

Why is this only specific to sessions?

Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

We know, that, objects can be bounded to session, request, and application. (leave the page for JSP), Why is it specific to session bounded objects to get notification, when they about to be added and removed to session (HttpSessionBindingListener)? There is HttpSessionActivationListener interface, to get notification when the session about to be migrate. But, why is this special to session? No other scopes(request, application) have this feature?

Thanks!


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Sudhakar Duraiswamy
Ranch Hand

Joined: Dec 20, 2007
Posts: 43
Well its the need that is the basis for features added.

My Logical inner voice says , that since its the session thats responsible for maintaining the state and available in memory for access (unlike request which gets destroyed immediately once its purpose is served), and available in thousands in server's memory (unlike servletcontext only one available for the entire application) one would need all the trackings that one can think of to efficiently maintain (adding /removing/updating/invalidating)session objects ensuring that the application is always performant


Sudhakar
SCJP 5.0 93%| SCWCD (prep. ongoing))
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Any reasons?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Do you see any real life use of a HttpRequestBindingListener or ServletContextBindingListener??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
 
subject: Why is this only specific to sessions?