I've just tried to add session listeners in my test web app the HttpSessionBindingListener and HttpSessionAttributeListener ones; They both implemented into my test object as :
public class MySessionListener implements HttpSessionBindingListener,HttpSessionAttributeListener
{
//implemented methods...
}
The thing is...
I tried code like a
session.setAttribute("name",new TestValue());
as a result, I expected to call HttpSessionBindingListener
event like valueBound(...)
but I have called just the HttpSessionAttributeListener
one as attributeAdded(...)
only :(
Moreover, concerning the valueUnbound(...)
method attitude is totally the same thing as I mentioned for I use code like
session.removeAttribute("name");
...but I get all the same attributeRemoved(...)
being called only :S
I wanted to try putValue() method instead but right now I am watching HttpSession docs which says that "putValue is Deprecated. As of Version 2.2, this method is replaced by setAttribute(java.lang.String, java.lang.Object)"
So I don't get it why the valueBound(...)
or valueUnbound(...)
doesn't invoke and how to invoke them anyway?
Thanks