If an application needs to clean up resources when the application is shut down, which listener should be used?

  • HttpSessionListener
  • ServletContextAttributeListener
  • ServletContextListener
  • ServletRequestListener
The ServletContextListener is used to perform actions during the initialization and destruction of the web application, making it suitable for cleaning up resources on application shutdown.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *