ServletContextListener
receives notifications about the changes to the ServletContext.
public
interface ServletContextListener extends EventListener {
public
void contextInitialized(ServletContextEvent sce);
public
void contextDestroyed(ServletContextEvent sce);
}
Method | Description |
void contextInitialized(ServletContextEvent e) | Method is invoked when the Application started. |
void contextDestroyed(ServletContextEvent e) | Method is invoked when the Application destroyed. |
There
are 2 ways to add ServletContextListener to the Application.
- Using Deployement Descriptor
- Using WebListener Annotation
No comments:
Post a Comment