Java-ServletContextEvent-ServletContextAttributeEvent
2015-10-23 19:45
483 查看
//这是一个事件类用来通知一个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; } }
相关文章推荐
- struts2值栈学习
- java中的代码初始化顺序
- Java-ServletContext
- Java-ServletContext
- Java-ServletContext
- Java Web 路径问题
- JAVA异常
- Java内存泄露原因详解
- Spring注解讲解
- java日期工具类DateUtil-续一
- Java 正则表达式学习总结和一些小例子
- java日期工具类DateUtil-续二
- java日期工具类DateUtil
- java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow
- Spring 3 以后的注解介绍(转载)
- Spring @Resource、@Autowired的注解注入
- Spring4 学习笔记(3)-Spring 基于 XML 的方式配置 Bean(供自己学习)
- springmvc返回.html页面报404
- Spring4 学习笔记(1)-入门及 HelloWorld -(供自己学习)
- 改善Java文档的理由、建议和技巧