• 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Small listener element doubt  RSS feed

 
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: 27
  • 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 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
 
Fire me boy! Cool, soothing, shameless self promotion:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!