SCJP ,SCWCD
The Listerners are implemented in a seperate class. But we can implement the HttpSessionAttributeListener in the attribute class itself. For example there is a class Employee and you want to perform some action when the attribute is added or removed from the session. In this case you can implement the HttpSessionAttributeListener in the Employee class itself.
public class Employee implements HttpSessionAttributeListener {
private String name;
// setter and getter method for name
public void attributeAdded(HttpSessionBindingEvent sbe){ }
// for attribute remove and replaced.
}
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
Thanks and regards,
Elan
Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />[email protected]
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
SCJP ,SCWCD
Thanks and regards,
Elan
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
{261} Bang box:
The Bang! box on pg 261 is erroneous and should be dropped altogther.
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |