• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

listener tag in DD

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Die Fledermaus does not fear such a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic