• 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

Servlet Listeners--not working

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am running j2sdk1.4.x, with Tomcat 4.1.x. I have made a listener, from different tutorials I have found, and it isn't working here is the listener code:

And here is my .jsp code that I want to run this upon:

Lastly, here is my web.xml file for this application:

etc etc etc....

Everytime I run the Sessions.jsp page, I always get the answer of "0" persons have active sessions.

Does anyone see any glaring errors that I might have made?

Much thanks for any help.

Mike
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check by printing something in your sessionCreated(), and sessionDestroyed() method.

you haven't specified the package where your listener resides. this might be a problem.

i mean you didn't wrote something like following in your listener class e.g.

package com.something;


thanks.
 
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try putting the <listener> element just before the <servlet> element.
For more information about web.xml elements and their order click here.

Sheldon Fernandes
 
Mike Parker
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, thanks for the answers.

I do have the package in the listener class--just didn't paste it to the forum. I put System.out.println in the sessionCreated method, but it didn't do anything.

I do have the listener tag before the servlet in web.xml. Any other ideas?
 
reply
    Bookmark Topic Watch Topic
  • New Topic