HttpSession.putValue()和removeValue()都是Deprecated的。
解决方案 »
- hibernate 映射问题!!!在线等
- jbpm工作流是否有赛跑的模式
- "java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagExtraInfo "这个错误怎么解决呀!!急!
- 论String操作时间复杂度
- 下载ZIP文件报CRC校验错误
- 求算法:将“IP:端口号:随机两位数”编码为长度是6的字符串(包括数字和大小写字母)
- 关于smartUpload上传文件问题,耗费资源
- 关于tomcat和iis整合后,servlet不能执行的问题
- 位老大知道哪有比较好的免费的个人主页啊,我想上传一个自己用JSP做的主页。谢谢!
- 急,在线等待。。。 如何运行有计算功能的一串String?
- WebLogic8.1怎么启动不了呢?
- jsp页面中字的长度控制的问题。
import javax.servlet.http.HttpSessionBindingEvent;public class MySessionListener implements HttpSessionAttributeListener { public void attributeAdded(HttpSessionBindingEvent arg0) {
System.out.println("attributeAdded"); } public void attributeRemoved(HttpSessionBindingEvent arg0) {
System.out.println("attributeRemoved"); } public void attributeReplaced(HttpSessionBindingEvent arg0) {
System.out.println("attributeReplaced"); }}
//web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<listener>
<listener-class>com.yan.MySessionListener</listener-class>
</listener></web-app>
//MyJsp.jsp<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'MyJsp.jsp' starting page</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">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
This is my JSP page. <br>
<%
//session.setAttribute("aaa","AAA");
session.setAttribute("SSSSSSS",new Vector());
// session.removeAttribute("aaa");
//session.getSessionContext();
//session.setMaxInactiveInterval(0);
session.invalidate();
%>
</body>
</html>
http://edocs.bea.com/wls/docs81/webapp/app_events.html