标签:监听器 blog value lis ati moved contex type web
1 package web.listener; 2 3 import javax.servlet.ServletContextEvent; 4 import javax.servlet.ServletContextListener; 5 import javax.servlet.annotation.WebListener; 6 7 /** 8 * ServletContext监听器 9 * 可以在这个监听器存放一些在Tomcat启动时就要完成的代码! 10 * */ 11 @WebListener() 12 public class AListener implements ServletContextListener { 13 @Override 14 public void contextInitialized(ServletContextEvent sce) { 15 System.out.println("哇,我来了"); 16 } 17 18 @Override 19 public void contextDestroyed(ServletContextEvent sce) { 20 System.out.println("哇,再见"); 21 } 22 }
标签:监听器 blog value lis ati moved contex type web
原文地址:http://www.cnblogs.com/gdwkong/p/7634611.html