aspose file tools
The moose likes Servlets and the fly likes HttpSessionListener  J2EE 1.4 change Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "HttpSessionListener  J2EE 1.4 change" Watch "HttpSessionListener  J2EE 1.4 change" New topic
Author

HttpSessionListener J2EE 1.4 change

Mukesh Mittal
Greenhorn

Joined: Dec 29, 2005
Posts: 16
In J2ee 1.4 Servlet Spec mentioned about HttpSessionListener sessionDestroyed() functioon

-- Its a Notification that a session is about to be invalidated

while in previous versions
Notification that a session was invalidated


What's the advantage of changing this?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56202
    
  13

Being notified before the session is invalidated gives you the opportunity to inpsect the session and its scoped variables prior to invalidation.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Mukesh Mittal
Greenhorn

Joined: Dec 29, 2005
Posts: 16
Can you give one example in which we inspect before invalidate.I am still trying to understand practical use of this.

Can we denied invalidating based on certain condition in this function.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56202
    
  13

Originally posted by Mukesh Mittal:
Can you give one example in which we inspect before invalidate.I am still trying to understand practical use of this.


For example if you need the info in a session scoped variable in order to properly release a resource.

Originally posted by Mukesh Mittal:
Can we denied invalidating based on certain condition in this function.


No.
Mukesh Mittal
Greenhorn

Joined: Dec 29, 2005
Posts: 16
Thanks for the clarification.

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: HttpSessionListener J2EE 1.4 change
 
Similar Threads
Invalidate Session Sequence
problem with servlet listeners
SessionListener false positives?
Session timeouts and listeners....
HttpSessionListener