Operating Systems: i5/OS
             Personalize the table of contents and search results

 

Example: Creating a servlet context listener with com.ibm.websphere.DBConnectionListener.java

 

The following example shows how to create a servlet context listener:

package com.ibm.websphere;

import java.io.*;
import javax.servlet.*;

public class DBConnectionListener implements ServletContextListener 
{
     // implement the required context init method
    void contextInitialized(ServletContextEvent sce)
    {
    }

     // implement the required context destroy method
    void contextDestroyed(ServletContextEvent sce)
    {
    }
}



 

Related concepts


Application life cycle listeners and events

 

Related tasks


Developing servlets with WebSphere Application Server extensions

 

Related Reference


Listener classes for servlet context and session changes
Web applications: Resources for learning

 

Reference topic