• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

about listener

 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers
i attended this qn in mock exam i am confused with the answer

How do you declare listeners MyFirstListener and MySecondListener in web.xml file. (select one)




i thought the answer is A but the ansewr given is B . which one is correct.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The answer is B exactly!
Because you can not write multi <listener-class> in a <listener> tag.
You have to separate them into two <listener> tag!
One <listener> tag have ONLY ONE <listener-class> tag.
 
Sundar Murthi
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But we can also set two or more listener in a single listener tag?

the two are valid can u able to conform to me


thanks
 
liny
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sundar Murthi:
But we can also set two or more listener in a single listener tag?

the two are valid can u able to conform to me


thanks




Set two or more listener-class in a listener tag is useless.
Here is the web-app_2_3.dtd you can read.
You can find the "listener-class" in the web-app 2.3.
And it says "<!ELEMENT listener (listener-class)>".
That means one listener MUST and ONLY have ONE listener-class tag.
In my opinion, if you set more listener-class, Container will ignore second and others!

PS: in web-app_2_3.dtd
* means you can add this tag zero to many.
? means you can add this tag zero to one at most.
+ means you must add this tag one or more.
if there is no punctuation, it means you must add only one this tag.

If I am wrong, please tell me.
[ December 10, 2004: Message edited by: liny liny ]
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you are right
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic