• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

order of elements in web.xml - DD

 
Srikanth shetty Nukala
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a restriction on order of elements in web.xml deployement descriptor.

an excerpt from servlet spec: " The sub elements under web-app can be in an arbitrary order in this version of the specification."

so there is no order rule in 2.4 spec.

correct me if i am wrong.
 
singh santosh
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so there is no order rule in 2.4 spec.


yes ,u r right... there is no order rule in 2.4 specs

regards
-santosh
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on whether you're using the DTD or the XML Schema when applying a schema to your deployment descriptor. In DTDs, the order of elements is important, but in Schemas this is less strict (provided sub-elements appear in the right places etc.).

You'll know which you're using because you'll have used a DOCTYPE declaration if you're using a DTD, and some xsl: namespace attributes on the root element if you're using an XML Schema.

XML Schemas are much more flexible and therefore are replacing DTDs, and as a result, all Server 2.4+ specifications incorporate a Schema in preference to the DTD (however, there is still a DTD available for 2.4).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic