Here is the DTD for <web-app> element:
<!ELEMENT web-app (icon?, display-name?, description?, distribut-able?,
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*, ejb-local-ref*)>
The order in which sub-elements are there in DTD should be followed while writing DD file.
Also note the meaning of following
* : 0 or more occurence
? : 0 or 1 occurence
+ : 1 or more occurence
| : means or
if no symbol than mandatory with exactly one occurence
I hope it helps.
Thanks and regards
Java Certification Test Simulators � J@Whiz, SCWCD@Whiz http://www.whizlabs.com/jwhiz
Why? ... because that's the order that the DTD specifies.
Note that some app servers choose to be less strict about order, however Tomcat is not one of them.
The short answer to your first question is: yes.
The short answer to you second question is: because they said so.
On a more serious note:
I am by no means an XML guru, but my understanding is the whole point of it is to simplify and standardize a way to transmit information between two entities. The Deployment descriptor specifies the order in which the tags must come in order to simplify the communication. That way the a DTD I create will look the same and folow the same format as one that you create. It also allows the server to know exactly which tags are expected when and eases the parsing of the DTD by the server.
hope that helps a little bit, I'm sure someone else knows a bit more on it and will add to this for you....
Sun Certified Programmer for the Java� 2 Platform
Originally posted by Marcos Maia:
Yes, I work with WebLogic and it doesn�t complain about the order of the tags, at least some wich I�ve tryied, the most funny is that if you use the jsp compiler from WL it complains but you can run it and doesn�t have problems.
PS - you should change your name to match JavaRanch rules(or a sheriff will tell you to do so), take a look at: http://www.javaranch.com/name.jsp
[This message has been edited by Marcos Maia (edited October 24, 2001).]