在WebApplication中监听Session的创建和消失,要Servlet2.3才能用,使用前要在WebApplication的deploy scriptor中声明。

解决方案 »

  1.   

    public interface HttpSessionBindingListener extends EventListener 
    ___________________________________________________________________________
    Objects implement this interface so that they can be notified when they are being bound or unbound from a HttpSession. When a binding occurs (using HttpSession.putValue) HttpSessionBindingEvent communicates the event and identifies the session into which the object is bound. 
    Similarly, when an unbinding occurs (using HttpSession.removeValue) HttpSessionBindingEvent communicates the event and identifies the session from which the object is unbound. 
    -------------------------------------------------------------------------------Get more information, reference to jsdk API Documentation(javax.servlet.http)
      

  2.   

    这个interface可以获得某一个session中的值吗?例如getValue()??/