How to get a notification when session attribute was changed?
HttpSessionAttributeListener will make the servlet container inform you about session attribute changes. The notification is in a form of
HttpSessionBindingEvent object. The
getName() on this object tell the name of the attribute while the
getValue() method tell about the value that was added, replaced or removed.
After your listener is ready don't forget to configure it in the web application deployment descriptor, the web.xml file.