• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HttpSessionListener in Tomcat

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Tomcat 5.5. I created a class that implements HttpSessionListener, but I cannot get any of the events to be raised.

The code for the class is:

/*************************************/
package ca.fcc.ObjectiveFour;

import javax.servlet.http.*;

public class MyHttpSessionListener implements HttpSessionListener
{
public void sessionCreated(HttpSessionEvent anEvent)
{
System.out.println("MyHttpSessionListener sessionCreated invoked!");
}

public void sessionDestroyed(HttpSessionEvent anEvent)
{
System.out.println("MyHttpSessionListener sessionDestroyed invoked!");
}
}

/*************************************/

In the web.xml I have the listener declared... but no events are raised. Here is how it is declared in the web.xml:

<listener>
<listener-class>ca.fcc.ObjectiveFour.MyHttpSessionListener</listener-class>
</listener>

Any idea as to why this won't work?
 
reply
    Bookmark Topic Watch Topic
  • New Topic