Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Small listener element doubt

 
Jas Oberai
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
 
vivek mahadevan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please see the servlet specification on page 139
 
Narendra Dhande
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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic