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�����õ�
*/