File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt about lister/listner-class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt about lister/listner-class" Watch "Doubt about lister/listner-class" New topic
Author

Doubt about lister/listner-class

Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 339
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

Joined: Nov 28, 2006
Posts: 292
The latter one.


Turn on, tune in, drop out.
Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
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.


Fun programming etcetera!
Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 339
Thanks

Frank
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Doubt about lister/listner-class
 
Similar Threads
Number of Instances
Problem with ServletContextListener
Javascript question
About listner entry in the DD???
database connection in init() of servlet