//这是一个事件类用来通知一个web 应用的servlet 上下文的改变
public class ServletContextEvent extends java.util.EventObject { 

	/** Construct a ServletContextEvent from the given context.
	 *
	 * @param source - the ServletContext that is sending the event.
	 */
    public ServletContextEvent(ServletContext source) {
	super(source);
    }

	/**
	 * Return the ServletContext that changed.
	 *
	 * @return the ServletContext that sent the event.
	 */
    public ServletContext getServletContext () {
	return (ServletContext) super.getSource();
    }

}
public class ServletContextAttributeEvent extends ServletContextEvent {
	private String name;
	private Object value;

	/** Construct a ServletContextAttributeEvent from the given context for the
	** given attribute name and attribute value.
	*/
	//构造一个servlet上下文属性事件
	public ServletContextAttributeEvent(ServletContext source, String name, Object value) {
	    super(source);
	    this.name = name;
	    this.value = value;
	}

	/**
	* Return the name of the attribute that changed on the ServletContext.
	*
	*/

	public String getName() {
		return this.name;
	}

	/**
	* Returns the value of the attribute that has been added, removed, or replaced.
	* If the attribute was added, this is the value of the attribute. If the attribute was
	* removed, this is the value of the removed attribute. If the attribute was replaced, this
	* is the old value of the attribute.
	*
	*/

	public Object getValue() {
	    return this.value;
	}
}

最新文章

  1. 原生JavaScript实现hasClass、addClass、removeClass、toggleClass
  2. Html5+Css3制作下拉菜单的三种方式
  3. NSMutableAttributedString(转)
  4. cocos2dx && Lua 环境配置
  5. php路径目录解析函数dirname basename pathinfo区别及实例
  6. python mysql desc
  7. GLSL实现Interactive Fluid 流体【转】
  8. javasctipt显示几分钟前、几天前等
  9. ORM之一:适合我的ORM
  10. poj2960 S-Nim
  11. Docker学习笔记 — Docker私有仓库搭建【转载】
  12. Elasticsearch基础教程
  13. Invalid environment specified: http://datatables.org/alltables.env
  14. ROS之坑
  15. Flutter工程无法找到Android真机或Android模拟器
  16. HBase应用快速开发
  17. Python date,datetime,time等相关操作总结
  18. vue-router导航钩子
  19. webpack打包之无依赖模块
  20. Linux 双向 SSH 免密登录

热门文章

  1. JDK 源码学习——ByteBuffer
  2. sklearn:聚类clustering
  3. 理解性能的奥秘——应用程序中慢,SSMS中快(2)——SQL Server如何编译存储过程
  4. activiti processEngineLifecycleListener使用
  5. Unable to access the IIS metabase.You do not have sufficient privilege
  6. Java程序员的必备知识-类加载机制详解
  7. 【一天一道LeetCode】#326. Power of Three
  8. Request中Attribute 和 Parameter 的区别
  9. Android进阶(二十五)setTextColor()的参数设置方式
  10. Android进阶(一)几种网络请求方式详解