tw.com.javaworld.CH11.MyServletContextListener (Java2HTML)

| MyServletContextListener.java |

    1 package tw.com.javaworld.CH11;
    2
    3 import javax.servlet.ServletContextEvent;
    4 import javax.servlet.ServletContextListener;
    5
    6 public class MyServletContextListener implements ServletContextListener {
    7
    8     public void contextInitialized(ServletContextEvent event) {
    9         String Init = (String)event.getServletContext().getInitParameter("Init");
    10        System.out.println("InitĄG" + Init);
    11
    12        event.getServletContext().log("Tomcat is running ...");
    13    }
    14
    15    public void contextDestroyed(ServletContextEvent event) {
    16
    17        event.getServletContext().log("Tomcat is Shutdown ...");
    18    }
    19
    20}
    21