Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessionListener J2EE 1.4 change

 
Mukesh Mittal
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Being notified before the session is invalidated gives you the opportunity to inpsect the session and its scoped variables prior to invalidation.
 
Mukesh Mittal
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the clarification.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic