Friday, 5 September 2014

ServletContextListener

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.
  1. Using Deployement Descriptor
  2. Using WebListener Annotation


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment