• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why is there a listener-element in the TLD?

 
Jan Sterk
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the difference between the <listener> element in the TLD and the DD? What has such a listener to do with tags?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tag developer may add his own listeners to the web application. I don't think that this topic is at the exam.

JSP.7.1.9 Event Listeners
A tag library may include classes that are event listeners (see the Servlet 2.4 specification). The listeners classes are listed in the tag library descriptor and the JSP container automatically instantiates them and registers them. A Container is required to locate all TLD files (see Section JSP.7.3.1 for details on how they are identified), read their listener elements, and treat the event listeners as extensions of
those listed in web.xml
. The order in which the listeners are registered is undefined, but they are registered before application start.
 
Jan Sterk
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Chris, that's clear.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic