Package com.jk.web.servlets
Class JKWebContextListener
java.lang.Object
com.jk.web.servlets.JKWebContextListener
- All Implemented Interfaces:
jakarta.servlet.ServletContextListener,EventListener
@WebListener
public class JKWebContextListener
extends Object
implements jakarta.servlet.ServletContextListener
This class is a ServletContextListener responsible for initializing and
cleaning up resources during the life cycle of a web application.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextDestroyed(jakarta.servlet.ServletContextEvent sce) This method is called when the web application context is destroyed.voidcontextInitialized(jakarta.servlet.ServletContextEvent event) This method is called when the web application context is initialized.voidinit()This method initializes theJKWebContextListener.
-
Constructor Details
-
JKWebContextListener
public JKWebContextListener()
-
-
Method Details
-
init
public void init()This method initializes theJKWebContextListener. -
contextInitialized
public void contextInitialized(jakarta.servlet.ServletContextEvent event) This method is called when the web application context is initialized.- Specified by:
contextInitializedin interfacejakarta.servlet.ServletContextListener- Parameters:
event- Specifies the ServletContextEvent associated with context initialization.
-
contextDestroyed
public void contextDestroyed(jakarta.servlet.ServletContextEvent sce) This method is called when the web application context is destroyed.- Specified by:
contextDestroyedin interfacejakarta.servlet.ServletContextListener- Parameters:
sce- Specifies the ServletContextEvent associated with context destruction.
-