tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abhijat Thakur" <atha...@bdnacorp.com>
Subject HttpSessionBindingListener problem
Date Wed, 07 May 2003 23:22:17 GMT

I want to have handle to all sessions at all times in my application. The code looks something
like this.

public class SessionHandler implements HttpSessionBindingListener {
    
    private HttpSession s;
    
    public SessionObject(  ) {
       System.out.println("Called empty constructor of session object");
    }
    public SessionObject( HttpSession s ) {
       System.out.println("Created a new session in sessionObject");
       this.s = s;
    }
    /**
     * implementation of interface method
     */
    public void valueBound( HttpSessionBindingEvent e ) {
        System.out.println("Got Bound");
    }
    /**
     * implementation of interface method
     */
    public void valueUnbound( HttpSessionBindingEvent e ) {
        System.out.println("Got unbound");
    }   
    public HttpSession getSession () {
        return s;
    }
}

There is an entry in web.xml for SessionHandler
<listener>
	<listener-class>SessionHandler</listener-class>
</listener>

On starting up tomcat empty constructor of SessionHandler is called. However on creating a
new session the valueBound method is never called. What am i doing wrong ?

thanks 

abhijat

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message