File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt about lister/listner-class" Watch "Doubt about lister/listner-class" New topic

Doubt about lister/listner-class

Frank Jacobsen
Ranch Hand

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

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: 358

I agree. Here's the link:
subject: Doubt about lister/listner-class
It's not a secret anymore!