O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Event Listening

A servlet can be designated as an event listener. This enables the servlet to be notified when some external event or change has occurred.

There are a number of listener interfaces that you can implement in your servlet. All the listener interfaces extend java.util.EventListener.

Table 12.6 provides a list of the listener interfaces.

Table 12.6. Servlet Event Listener Interfaces
Listener Interface Notification
HttpSessionActivationListener When a session is activated or passivated
HttpSessionAttributeListener When a session attribute is added, removed, or replaced
HttpSessionListener When a session is created or destroyed
ServletContextAttributeListener When a servlet context attribute is added, removed, or replaced
ServletContextListener ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required