if BBUBUB is correct than, it can be infered that, when setAttribute is called for the second time than valueBound(for second attribute) is called before valueUnbound (for first attribute) is called.
I have read the spec but it doesnot specify the order in which valueBound valueUnbound methods are called.
so, can some one tell me the order in which methods valueBound/valueUnbound of Interface HttpSessionBindingListener will be called for the following code. assume there is a class called X that implements HttpSessionBindingListener. Now,
according to me the order must be 1. valueBound - for first object X() 2. valueUnbound - for first object X() 3. valueBound - for second object X()
but according to the answers of q55 final mock exam HFSJ, the order is
1. valueBound - for first object X() 2. valueBound - for second object X() 3. valueUnbound - for first object X()
can someone tell me the correct order in which these functions are called.
clearly, the order of execution is valueBound for the first one valueBound for the second one (because the value of the first one will be unBound only after it is replaced) valueUnbound for the first one (here, the string value is added, but the String class doesn't implement the HttpSessionBindingListener, so valueBound or Unbound won't be called for adding or removing "x") valueUnbound for the second one (because it has now been replaced by "x")
so clearly, the outpu will be B B UB UB
"It's not enough that we do our best; sometimes we have to do<br />what's required."<br /> <br />-- Sir Winston Churchill