Java-ServletRequestListener-ServletRequestAttributeListener
/**
* A ServletRequestListener can be implemented by the developer
* interested in being notified of requests coming in and out of
* scope in a web component. A request is defined as coming into
* scope when it is about to enter the first servlet or filter
* in each web application, as going out of scope when it exits
* the last servlet or the first filter in the chain.
*
* @since Servlet 2.4
*/
//Servlet请求监听器,开发者可以实现这个接口来监听请求进入或者离开web应用
public interface ServletRequestListener extends EventListener {
/** The request is about to go out of scope of the web application. */
//Request销毁监听
public void requestDestroyed ( ServletRequestEvent sre );
/** The request is about to come into scope of the web application. */
//Request初始化监听
public void requestInitialized ( ServletRequestEvent sre );
}
/**
* A ServletRequestAttributeListener can be implemented by the
* developer interested in being notified of request attribute
* changes. Notifications will be generated while the request
* is within the scope of the web application in which the listener
* is registered. A request is defined as coming into scope when
* it is about to enter the first servlet or filter in each web
* application, as going out of scope when it exits the last servlet
* or the first filter in the chain.
*
* @since Servlet 2.4
*/
//servlet 请求参数监听器,开发者可以实现这个接口来通知属性的改变
public interface ServletRequestAttributeListener extends EventListener {
/** Notification that a new attribute was added to the
** servlet request. Called after the attribute is added.
*/
//属性添加监听
public void attributeAdded(ServletRequestAttributeEvent srae);
/** Notification that an existing attribute has been removed from the
** servlet request. Called after the attribute is removed.
*/
//属性删除监听
public void attributeRemoved(ServletRequestAttributeEvent srae);
/** Notification that an attribute was replaced on the
** servlet request. Called after the attribute is replaced.
*/
//属性替代监听
public void attributeReplaced(ServletRequestAttributeEvent srae);
}
Java-ServletRequestListener-ServletRequestAttributeListener的更多相关文章
- JAVA监听器Listener
JAVA监听器Listener 一. 简介 监听器用于对web中内置对象的状态或者属性变化进行监听并做出相应响应的一种Servlet;在内置对象的生命周期中,产生.销毁等状态发生变化时,监听器就会进行 ...
- 在Java Web程序中使用监听器可以通过以下两种方法
之前学习了很多涉及servlet的内容,本小结我们说一下监听器,说起监听器,编过桌面程序和手机App的都不陌生,常见的套路都是拖一个控件,然后给它绑定一个监听器,即可以对该对象的事件进行监听以便发生响 ...
- Java Web 学习与总结(二)Servlet核心接口+Servlet3.0配置
Servlet3.0版本对Servlet配置进行了重大变革,Servlet类不需要再麻烦的去编辑web.xml文件了,只需要在类上面进行注释就可以了,获得了 Java 社区的一片赞誉之声,以下是新增的 ...
- 【JAVA EE企业级开发四步走完全攻略】
本文是J2EE企业级开发四步走完全攻略索引,因内容比较广泛,涉及整个JAVA EE开发相关知识,这是一个长期的计划,单个发blog比较零散,所以整理此索引,决定以后每发一季JAVA EE blog后会 ...
- Java开发工程师(Web方向) - 02.Servlet技术 - 第3章.Servlet应用
第3章.Servlet应用 转发与重定向 转发:浏览器发送资源请求到ServletA后,ServletA传递请求给ServletB,ServletB生成响应后返回给浏览器. 请求转发:forward: ...
- java web Listener的简单使用案例
1.web.xml的配置 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi= ...
- Java Servlet 3.0 新特性
Servlet 3.0 新特性概述 Servlet 3.0 作为 Java EE 6 规范体系中一员,随着 Java EE 6 规范一起发布.该版本在前一版本(Servlet 2.5)的基础上提供了若 ...
- Java Listener
六. Java Listener 1. Java Listener 简介 * Java Listener 1. Java Listener(即:Java 监听器):用于监听 ServletRequ ...
- Java EE javax.servlet中的ServletContext接口
ServletContext接口 public interface ServletContext (https://docs.oracle.com/javaee/7/api/javax/servlet ...
- java:(监听,上传,下载)
1.监听: index.jsp: <%@ page language="java" import="java.util.*" pageEncoding=& ...
随机推荐
- GDAL创建图像提示Driver xxx does not support XXX creation option的原因
经常在群里有人问,创建图像的时候为什么老是提示下面的信息. CPLError: Driver GTiff does not support DCAP_CREATE creation option Wa ...
- Hadoop的RPC通信原理
RPC调用: RPC(remote procedure call)远程过程调用: 不同java进程间的对象方法的调用. 一方称作服务端(server),一方称为客户端(client): server端 ...
- 软件测试之BUG分析定位概述(QA如何分析定位BUG)
你是否遇到这样的场景? QA发现问题后找到DEV说: 不好了,你的程序出问题了! DEV(追查半小时之后): 唉,是你们测试环境配置的问题 唉,是你们数据不一致 唉,是你们**程序版本不对 唉,是** ...
- mysql进阶(二十七)数据库索引原理
mysql进阶(二十七)数据库索引原理 前言 本文主要是阐述MySQL索引机制,主要是说明存储引擎Innodb. 第一部分主要从数据结构及算法理论层面讨论MySQL数据库索引的数理基础. ...
- 22 Notification 通知栏代码
结构图: MainActivity.java package com.qf.day22_notification; import android.app.Activity; import androi ...
- JSP1.x 自定义标签
Tag接口 任何一个标签都对应着一个java类,该类必须实现Tag接口,JSP遇到一个标签后后,将通过一个tld文件查找该标签的实现类,并运行该类的相关方法 import javax.servlet. ...
- #VSTS日志# Xamarin构建支持和一大波更新
距离上次更新#VSTS日志#已经有将近3个月的时间了,赶上最近Xamarin开源免费的消息,VSTS也推出了更多跨平台的支持和许多其他功能.这里列出一些小编觉得比较重要. 1. Xamarin 构建模 ...
- Python读取JSON数据,并解决字符集不匹配问题
今天来谈一谈Python解析JSON数据,并写入到本地文件的一个小例子. – 思路如下 从一个返回JSON天气数据的网站获取到目标JSON数据串 使用Python解析出需要的部分 写入到本地文件,供其 ...
- Oracle使用游标为所有用户表添加主键语句
应用场合:数据表新增自增一主键能加快数据表的访问速度,而且是整形的索引速度最快.本程序适合在导入Oracle数据库时删除不存在主键的情况下运行. 代码说明:所有的表主键字段名都设置为ID,如果已存在I ...
- 08 ListView 优化的例子
package com.fmy.homework; import java.util.List; import com.fmy.homework.httputil.HttpUtil; import c ...