Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

"valueUnbound" behaviour  RSS feed

 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to do some processing when the bean is out of session; so far I've identified two cases when the method valueUnbound is called:
- when the session is invalidated
- when we specifically remove the bean from the session.
What happens if the user just closes the browser? This event is not triggered. Is it normal? Or is there a way to detect that?
Regards,
Adrian
Sun Certified Programmer for Java2 Platform
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adrian
Using the HttpSessionBindingListener will let you know when the object that implements it is boound or unound from a session so yes, and invalidated session and removing an object from the session will trigger the valueUnbound method. as far as the user closing the browser, there is no way to detect that, eventually the session will time out - then the method would be triggered.
hope that helps
 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank's Dave
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!