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) { } }