This section contains the details about Types of Listeners.
Types of Listener
As we discuss earlier Listener is predefined interface that invoked by web
container on the occurrence of some event. The listener methods are called in
response to the relevant events. For example, a method addition.
Types of Listener :
- Request Listener
- Context Listener
- Session Listener
Request Listener deals with the request object. It responds to the change in the request or request object.
Context Listener deals with the servlet context. For servlet context events, the event listener classes can receive notification when the Web Application is deployed or is being undeployed (or when Server shuts down), and when attributes are added, removed, or replaced.
Session Listener deals with the session object. For HTTP session events, the event listener classes can receive notification when an HTTP session is activated or is about to be deactivated, and when an HTTP session attribute is added, removed, or replaced.