May 2004
Beginner to intermediate
1032 pages
23h 48m
English
A servlet can be designated as an event listener. This enables the servlet to be notified when a lifecycle event or a change to request or session attributes 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.
| Listener Interface | Notification |
|---|---|
| ServletRequestAttributeListener | When a request attribute is added, removed, or replaced |
| ServletRequestListener | When the processing of a request is started |
| HttpSessionAttributeListener | When a session attribute is added, removed, or replaced |
| HttpSessionListener | When a session is created, replaced, or ... |
Read now
Unlock full access