The valueBound method must be called before the object is made available via the getAttribute method of the HttpSession interface. The valueUnbound method must be called after the object is no longer available via the getAttribute method of the HttpSession interface.
Originally posted by Chaminda (SCJP) Amarasinghe: I think manually no need to call above methods... when we bound (or unbound) container will call these methods... So why
You are right, we don't call these methods in our code. The above statement is actually a directive to the servlet container vendors regarding when their container should call these methods. In other words, if you were writing a servlet container, you would have to call these methods as explained by the specification.