Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt about lister/listner-class

 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Last quistion before the exam tommorow 9:00 CET !

I have seen many exeamples off



But if you have 2 or more listners declared

can you declare it this way:



Or dou yoy have to declare it this way:





Frank
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The latter one.
 
Dave Wingate
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would think that only the latter wold be valid.

The dtd for web.xml describes the listener element as:


<!ELEMENT listener (listener-class)>



Notice that "listener-class" is not followed by an asterisk or a plus sign, so I think you'd be required to list exactly one listener-class element per listener tag.
 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks

Frank
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!