import javax.servlet.* ;
public class ServletContextAttributeListenerDemo implements ServletContextAttributeListener {
public void attributeAdded(ServletContextAttributeEvent a){
System.out.println("** 增加属性 --> 属性名称:" + a.getName() + ",属性内容:" + a.getValue()) ;
}
public void attributeRemoved(ServletContextAttributeEvent a){
System.out.println("** 删除属性 --> 属性名称:" + a.getName() + ",属性内容:" + a.getValue()) ;
}
public void attributeReplaced(ServletContextAttributeEvent a){
System.out.println("** 替换属性 --> 属性名称:" + a.getName() + ",属性内容:" + a.getValue()) ;
}
}
/*
<listener>
<listener-class>
xs.mvc.listenerdemo.ServletContextAttributeListenerDemo
</listener-class>
</listener>
*/