• 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

Invalidate Session Sequence

 
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's written in Hanhumant Deshmukh's book that
"The servlet container calls the sessionDestroyed() method after the session is invalidated. but when i invalidated a session, it didn't called sessionDestroyed() though it called() valueUnbound()
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sessionDestroyed() of the HttpSessionListener interface is called when the session is about to be invalidated, not after.
Did you register the listener correctly ?
 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you are right. The output is :

Inside Session Created()
Adding useridwrapper attribute to session
Inside valuebound()
Inside attributeAdded()
Added useridwrapper attribute to session
Calling Invalidate()
Inside Session Destroyed()
Inside valueUnbound()
Inside attributeRemoved()
Invalidate() Over

But why Destroyed() first & then valueUnbound() & attributeRemoved(). Also does anywhere in HFSJ book this sequence is mentioned ?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic