//这是一个事件类用来通知一个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;
	}
}

Java-ServletContextEvent-ServletContextAttributeEvent的更多相关文章

  1. 几百道常见Java初中级面试题

     注:  有的面试题是我面试的时候遇到的,有的是偶然看见的,还有的是朋友提供的, 稍作整理,以供参考.大部分的应该都是这些了,包含了基础,以及相对深入一点点的东西.   JAVA面试题集 基础知识: ...

  2. 浅谈servlet版本

    说白话,eclipseJ2EE版本新建一个web项目后,在IDE中的项目根目录下会看到2.3,2.4,2.5,3.0,3.1....据说最新的4.0在路上,已经有草案了,很期待ing. 360百科是这 ...

  3. JTSL/EL Expression学习

    最早的一个学习笔记,时间过去了久了,供java web初学者参考. JTSL/EL Expression学习安排 学习目标:掌握几个常见标签的使用,通晓工作原理,详细到代码层面,遇到问题时能查得出异常 ...

  4. servlet--百度百科

    Servlet(Server Applet),全称Java Servlet, 未有中文译文.是用Java编写的服务器端程序.其主要功能在于交互式地浏览和修改数据,生成动态Web内容.狭义的Servle ...

  5. Spark案例分析

    一.需求:计算网页访问量前三名 import org.apache.spark.rdd.RDD import org.apache.spark.{SparkConf, SparkContext} /* ...

  6. Java监听器

    监听器 1.概念 监听器:主要是用来监听特定对象的创建,属性的变化的!,本质上却是一个实现特定接口的普通java类! 对象分为自己创建自己使用的,和别人创建自己用的,自己创建的不需要监听,值需要取监听 ...

  7. 【Java EE 学习 21 上】【其它类型的监听器】【使用HttpSessionActivationListener监听session的活化和钝化】

    一.ServletContextListener  Method Summary  void contextDestroyed(ServletContextEvent sce)           R ...

  8. Java EE 学习总结

    1.Java EE WEB 工程项目文件结构 组成:静态HTML页.Servlet.JSP和其他相关的class: 每个组件在WEB应用中都有固定的存放目录. WEB应用的配置信息存放在web.xml ...

  9. Java中Filter、Servlet、Listener的学习

    1.Filter的功能filter功能,它使用户可以改变一个 request和修改一个response. Filter 不是一个servlet,它不能产生一个response,它能够在一个reques ...

  10. 转 Java中Filter、Servlet、Listener的学习

      1.Filter的功能filter功能,它使用户可以改变一个 request和修改一个response. Filter 不是一个servlet,它不能产生一个response,它能够在一个requ ...

随机推荐

  1. Django 是如何实现用户登录和登出机制的(默认版本-数据库版本)

    Django session 字典,保存到数据库的时候是要先序列化的(session.encode方法), 读取的时候反序列化(session.decode),这样比较安全. 一 settings.p ...

  2. java自动装箱拆箱总结

    对于java1.5引入的自动装箱拆箱,之前只是知道一点点,最近在看一篇博客时发现自己对自动装箱拆箱这个特性了解的太少了,所以今天研究了下这个特性.以下是结合测试代码进行的总结. 测试代码: int a ...

  3. 看见的力量 – (I) 解题的思维

    本文转自台湾李智桦老师的博客,原文地址 这篇文章:已经梗了我三个多星期了.这期间飞了二次大陆做演讲.往返几个大城市做教授敏捷开发运用在精实创业的课程.教材内容都是简体的,它们始终没有机会在国内用上,心 ...

  4. Springmvc注解注入的简单demo

    今天看了注解注入觉得确实简化了xml配置,一般情况下Spring容器要成功启动的三大要件分别是:Bean定义信息,Bean实现类,以及spring本身.如果采取基于XML的配置,Bean信息和Bean ...

  5. FFmpeg源代码结构图 - 解码

    ===================================================== FFmpeg的库函数源代码分析文章列表: [架构图] FFmpeg源代码结构图 - 解码 F ...

  6. Hibernate系列学习之(二) 多对一、一对一、一对多、多对多的配置方法

    这是近期做案件录入.java项目中体会的几点:项目理解很是深刻,和大家共勉! hihernate一对多关联映射(单向Classes----->Student) 一对多关联映射利用了多对一关联映射 ...

  7. Java基础---Java---IO流-----BufferedReader、BufferedWriter、缓冲区、装饰设计模式及和继承的区别

    IO流 IO流用来处理设备之间的数据传输 java对数据的操作是过流的方式 流按操作数据分为两种:字节流与字符流 流按流向分为:输入流,输出流. IO流常用基类 字节流的抽象基类:InputStrea ...

  8. iOS中 如何将自己的框架更新到cocopods上 韩俊强的博客

    每日更新关注:http://weibo.com/hanjunqiang  新浪微博! 为了更方便的集成第三方框架有了cocopods 的, 当我们有了相对比较好的框架的时候如何更新到cocopods ...

  9. scala学习笔记5 (隐式转化/参数/类)

    隐式转化: 隐式参数: 隐式类:

  10. 饮一盏Bug留香,唱一曲项目飞扬

    沿途的风景    牵挂的项目    两情迢迢 学生档案管理项目在2月的末尾从稍带寒意的季节里完成了第一次迭代,验收的结果不尽善尽美,演示的功能也惨不忍睹,各种"关爱"的点评充斥耳旁 ...