Example: 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 lifecycle listeners and events
Related reference
Listener classes for servlet context and session changes
Web applications: Resources for learning



Searchable topic ID:   xweb_sctxl
Last updated: Jun 21, 2007 9:56:50 PM CDT    WebSphere Application Server for z/OS, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/xweb_sctxl.html

Library | Support | Terms of Use | Feedback