This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

valueUnbound method  RSS feed

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please list the scenarios of the HttpSessionBindingListener.valueUnbound method will be called.

like

1. When the session about to time out.
2.


While removing/replacing the attribute from the session , whether the unbound method will be called or not?


in the same way , when the session is about to timeout , removeAttribute() method should be called before the timeout right ??

somebody please clarify doubts.
 
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


how far you try this ?
-----------------------------------------------
While removing the attribute from the session
------------------------------------------------
 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i didnt try till now.

I just want to make sure my understanding in concepts. :-)
 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thought of sharing you the information :

When session was created


When the Dog Object Added to the Session.


When the added Dog object has been reaplced with another Dog Object.


when the replaced Dog Object Removed from the Session


Again When the Dog Object Added to the Session.


While invalidating the session.


so while removing /replacing the attribute from the session (using setAttribute/removeAttribute) unBound method will be called.

but during sessiont timeout / invalidation , only the unbound method will be called. NOT attributeRemoved method.
[ August 11, 2008: Message edited by: deepa raj ]
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so while removing /replacing the attribute from the session (using setAttribute/removeAttribute) unBound method will be called

When we set the attribute only valueBound is called not valueUnbound. If i am wrong please correct me.
RemoveAttribute or replacing - valueUnbound and corresponding attributeRemoved/attributeReplaced is correct.

eg.,
When we call twice setAttribute I feel only valueBound is called.
setAttribute("javaranch", new com.javaranch());
setAttribute("javaranch", new com.javaranch());
 
Lakshmi Narayanan
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While invalidating the session.

code:
--------------------------------------------------------------------------------

HttpSessionBindingListener.valueUnBoundHttpSessionListener.sessionDestroyed


What is the sequence on this
first valueUnbound and then sessionDestroyed right
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!