Events are the primary happening of something. Changing the state of an item is referred to as an occasion.

We can carry out a few critical responsibilities on the occurrence of those exceptions, along with counting overall and cutting-edge logged-in users, growing tables of the database at time of deploying the project, growing database connection items etc.

There are many Event Classes and Listener interfaces withinside the javax.servlet and javax.servlet.http packages.

Event Classes

The event training are given below:

  1. ServletRequestEvent
  2. ServletContextEvent
  3. ServletRequestAttributeEvent
  4. ServletContextAttributeEvent
  5. HttpSessionEvent
  6. HttpSessionBindingEvent

Event interfaces

The event interfaces are given below:

  1. ServletRequestListener
  2. ServletRequestAttributeListener
  3. ServletContextListener
  4. ServletContextAttributeListener
  5. HttpSessionListener
  6. HttpSessionAttributeListener
  7. HttpSessionBindingListener
  8. HttpSessionActivationListener