package smp;
import java.io.Serializable;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
public class SampleBindData implements HttpSessionBindingListener, Serializable{
private String firstName;
private String lastName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void valueBound(HttpSessionBindingEvent ev) {
HttpSession session = ev.getSession();
ServletContext sc = session.getServletContext();
sc.log("バインド属性名:" + ev.getName() + " バインドした属性値" + ev.getValue());
}
public void valueUnbound(HttpSessionBindingEvent ev) {
HttpSession session = ev.getSession();
ServletContext sc = session.getServletContext();
sc.log("バインド属性名:" + ev.getName() + " バインドした属性値" + ev.getValue());
}
}
|