jsp(对session监听)
来源:互联网 发布:网络光端机价格 编辑:程序博客网 时间:2024/06/07 02:44
1:jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
<title>对Application监听</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
<%
session.setAttribute("info", "监听器");
%>
<%
session.removeAttribute("info");
%>
</body>
</html>
2:listener(监听器)
package cn.com.filter;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;
public class HttpSessionAttributeListenerDemo implements
HttpSessionAttributeListener {
@Override
public void attributeAdded(HttpSessionBindingEvent event) {
System.out.println("**增加属性-->属性名称:"+event.getName()+",属性内容:"+event.getValue());
}
@Override
public void attributeRemoved(HttpSessionBindingEvent event) {
System.out.println("**替换属性属性-->属性名称:"+event.getName()+",属性内容:"+event.getValue());
}
@Override
public void attributeReplaced(HttpSessionBindingEvent event) {
System.out.println("**删除属性-->属性名称:"+event.getName()+",属性内容:"+event.getValue());
}
}
- jsp(对session监听)
- 对session的监听
- jsp(对request监听)
- servlet监听对session监听器
- 对jsp的一个小结(2)session、cookie、application
- session监听
- session监听
- session监听
- session监听
- session 监听
- Session监听
- Session监听
- JSP退出或注销时对session等的操作
- JSP session
- jsp---->Session
- JSP Session
- JSP SESSION
- JSP Session
- linux文件锁详解(设计文件很底层的操作)
- zkw Segment Tree
- 了jsp中四种传递参数的方法
- android中的ipc机制剖析
- poj之旅——1050
- jsp(对session监听)
- CCF 201612-1 最大波动 JAVA实现
- (仿超级课程表)结合MaterialSheetFab实现简单的课程表功能
- Micro Focus COBOL multi-thread solution
- 第十三天学习笔记
- js 字母和ASCII的转换
- uboot的环境变量
- codeforces - 337c Quiz【贪心】
- 新建对话框(模态和非模态)