Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

listener tag in DD

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the order of listener and servlet tags matters in DD?

eg. is the following invalid?

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes the order is necessary. <listener> element precedes the <servlet> element.
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Bassam Zahid:
Yes the order is necessary. <listener> element precedes the <servlet> element.



Sorry Bassam, but I don't agree. According to Servlet spec 2.4, SRV.13.4:
"1. web-app Element
...
All sub elements under this element can be in an arbitrary order."

So the order doesn't matter under <web-app>
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jose Esteban:


Sorry Bassam, but I don't agree. According to Servlet spec 2.4, SRV.13.4:
"1. web-app Element
...
All sub elements under this element can be in an arbitrary order."

So the order doesn't matter under <web-app>



I agree with u Jose... I guess, this order thing has been made lenient starting from servlet spec 2.4. so, we can have elements within in any arbitary order... unless, u know that the order matters to u... like in the case of ordering of filter DD elements...
 
Bassam Zahid
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jose Esteban for indicating the error. It is really astonishing to know that order is not necessary. I think till Servlet 2.3 it was necessary. Am I right?
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HFS on page 174 shows example of listener tag at the end of the DD so it seems that Jose's the man. Order is not important.
 
Get me the mayor's office! I need to tell him about this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic