Reputation: 5532
In web.xml
I have this
<session-config>
<session-timeout>2</session-timeout>
</session-config>
<listener>
<listener-class>myapplication.SessionListener</listener-class>
</listener>
In the SessionListener.java
I have
public void sessionDestroyed (HttpSessionEvent event){
System.out.println("Visitor Removed!!");
}
But it seems System.out.println("Visitor Removed!!")
has never been executed. I am new to Tomcat 6 and JSP. Any suggestion please?
Upvotes: 2
Views: 5613
Reputation: 1109570
This can have at least 3 causes:
sessionCreated()
as well.sessionDestroyed()
will be called. Or if you have a bit more patience, the server will run its low-prio timer job to reap all expired sessions.myapplication.SessionListener
class in the classpath as you think you're using, maybe the one actually in the classpath doesn't have a sysout line.Upvotes: 6