This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes calling a listener class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "calling a listener class" Watch "calling a listener class" New topic

calling a listener class

devika cha
Ranch Hand

Joined: Jun 28, 2004
Posts: 31
i have a class saying MyNewBindingClass which implements HttpSessionBindingListener
now how can i call this class from a servlet?
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
You don't call listeners, the container does. You also must put a <listener> element in your deployment descriptor to tell the container about your listener class.
sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
When to use listener? Please give me some examples.

I agree. Here's the link:
subject: calling a listener class
It's not a secret anymore!