The servlet listener interfaces that define the methods to be invoked in response to a desired event.
The servlet listener interfaces that define the methods to be invoked in response to a desired event. You may need to take some action in response to specific events - such as starting and stopping the Web application. To receive messages the listener class must be configured in the deployment descriptor web.xml
.
The following list of the listener interfaces:
ServletContextListener
Implementing an interface
ServletContextListener
promotes change notifications to the servlet context web application which it is part.ServletContextAttributeListener
ServletContextAttributeListener
interface can be used to receive messages about changes in the list of the attributes of the servlet context.HttpSessionListener
Implementing an interface
HttpSessionListener
promotes change notifications to the list of active sessions in a web applications.HttpSessionAttributeListener
We can store attributes in the
HttpSession
, then they will be available until the session ends.HttpSessionAttributeListener
interface can be used to receive messages about session attribute lists changes in a web applications.