This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!
See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Listeners  RSS feed

 
Ranch Hand
Posts: 431
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends

I know servlets to some extent but I am new to listener...My question is (may be very silly) if I want to add listeners to more than one event like ServletContextEvent and HttpSessionEvent and I have the listener classes in different files,then how can I declare both the classes in DD. Can I put 2 listener-class tags like



Or is there some other way?...Advance thanx...
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can add as many as you'd like.
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but it should be

<!ELEMENT listener (listener-class)> *

u can have one and only one listener-class in listener.
 
S.L.Narayanan
Ranch Hand
Posts: 431
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Bhumika, I couldnt understand what u r coming to say ...Can u explain with a piece of code?...
 
Bhumika Thakkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you have 2 listeners mySessionListener and myContextListener then in DD u would declare them as

<listener>
<listener-class>mySessionListener</listener-class>
</listener>

<listener>
<listener-class>myContextListener</listener-class>
</listener>

Notice that we have 2 separate listener elements. Its not 2 listener-class in one listener element.

Hope this makes it clear.
 
S.L.Narayanan
Ranch Hand
Posts: 431
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now I understood..Thanx for ur reply...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!