java代码067
文章目录
code067.java
package pack02;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
//UserInfoTrace�࣬����
public class code067 implements HttpSessionBindingListener
{
private String user;
private code066 container = code066.getInstance();
public code067()
{
this.user = "";
}
public void setUser(String user)
{
this.user = user;
}
public String getUser()
{
return this.user;
}
public void valueBound(HttpSessionBindingEvent e)
{
System.out.println(this.user + "������");
}
public void valueUnbound(HttpSessionBindingEvent e)
{
System.out.println(this.user + "������");
if (user != "")
{
container.removeUserInfo(user); //�Ƴ��û�
}
}
}
/*
*����UserInfoTrace�࣬��Ҫʵ��valueBound��valueUnbound����������
*���ж������sessionʱ��valueBound�����Զ�ִ�У�
*���ж����session�Ƴ�ʱ�� valueUnbound�����Զ�ִ�У�
*
* HttpSessionBindingListener�ӿڣ���Ψһ����Ҫ��web.xml�����õ�
*/
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册⭐️ Admin快速开发: https://show.cool-admin.com/
赞 0⭐️ 官方文档: https://cool-js.com
赞 0⭐️ chatgpt在线体验: https://cool-js.com/ai/chat-vip/index.html?r=helloworld
赞 0