ServletContextListener
Learn ServletContextListener (Servlet Listener, JSP Servlets) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
What is ServletContextListener? • ServletContextListener is an interface in the Servlet API that allows you to listen to lifecycle events of a web application's context. Purpose • Execute code when the web application starts or stops • Initialize shared resources like database connections • Clean up resources on shutdown