File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes is sibling elements in web.xml ordered? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "is sibling elements in web.xml ordered?" Watch "is sibling elements in web.xml ordered?" New topic

is sibling elements in web.xml ordered?

Yi Meng
Ranch Hand

Joined: May 07, 2003
Posts: 270
e.g. security-role and security-constraint, i saw some web.xml in which security-role comes after security-constraint and some other web.xml in which the order is the other round.

Meng Yi
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
Ordering of elements in XML has to be preserved.According to the dtd published on the Sun site, it is always security-constraint followed by security-role.
<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, filter*, filter-mapping*, listener*, servlet*,
servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,login-config?, security-role*, env-entry*, ejb-ref*,
web-app_2_3.dtd can be downloaded from
Don't get me started about those stupid light bulbs.
subject: is sibling elements in web.xml ordered?
It's not a secret anymore!