Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Small listener element doubt

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
please see the servlet specification on page 139
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
This will take every ounce of my mental strength! All for a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic