Various Listener interfaces and their methods and Event types in a web application


ServletContextListener: wrote a whole blog about it.

Methods: ContextInitialized(ServletContextEvent event)

ContextDestroyed(ServletContextEvent event)

ServletContextAttributeListener:  Notifies if an attribute has been added, removed or replaced to a web application context.

Methods: attributeAdded(ServletContextAttributeEvent event)

attributeRemoved(ServletContextAttributeEvent event)

attributeReplaced(ServletContextAttributeEvent event)

HttpSessionListener: To track active sessions in the application.

Methods: sessionCreated(HttpSessionEvent event);

sessionDestroyed(HttpSessionEvent event);

ServletRequestListener: Notifies about the arrival of request.

Methods: requestInitialized(ServletRequestEvent event);

requestDestroyed(ServletRequestEvent event);

ServletRequestAttributeListener: Notifies if a request attribute has been added, removed or replaced.

Methods: attributeAdded(ServletRequestAttributeEvent event)

attributeRemoved(ServletRequestAttributeEvent event)

attributeReplaced(ServletRequestAttributeEvent event)

HttpSessionBindingListener: Notifies the Objects of the class when these objects have been bound (set as attributes using session.setAttribute(string, object)) to or removed (removed using seesion.removeAttribute(string))from a session.

Methods:valueBound(HttpSessionBindingEvent event)

valueUnbound (HttpSessionBindingEvent event)

HttpSessionAttributeListeners: Notifies if a session attribute has been added, removed or replaced.

Methods: attributeAdded(HttpSessionBindingEvent  event)

attributeRemoved(HttpSessionBindingEvent event)

attributeReplaced(HttpSessionBindingEvent  event)

HttpSessionActivationListener: Notifies the objects of the class when the session to which they are bound migrates from one JVM to another in a clustered environment.

Methods: sessionDidActivate(HttpSession Event event);

sessionWillPassivate(HttpSessionEvent event);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s