• 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

Small listener element doubt

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pg825 in HFSJ
They say this is a valid listener element:


But,the web.xml specs says under listener only this element is optional and valid:


So,can someone please tell me how <description> becomes valid inside <listener>

Thanks in advance
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please see the servlet specification on page 139
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


<listener>
<listener-class>xyz</listener-class>
<description>watever</description>
<listener>



Still is not valid.

<description> is valid sub-element for <listener> element, but it should come before the <listener-class> sub-element.

Thanks
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

but it should come before the <listener-class> sub-element.


I don't agree. The order of elements is not important in Servlets 2.4
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Try it on any J2EE compliant container, where XML parsing of web.xml is enabled. It will surely give error.

Though the element which come directly under <web-app> , You can place the elemnt in any order sythatically. But the order of the sub-element under these elements is still important in Servlet 2.4 specifications. Tomcat will not give the error at it does not parse the web.xml at the time of deployment.

Thanks
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic