Dear Allan, 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 Pradeep Java Certification Test Simulators � J@Whiz, SCWCD@Whiz http://www.whizlabs.com/jwhiz
The short answer is "yes", except that all three are optional :-) 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.
Allan 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....
------------------ Dave Sun Certified Programmer for the Java� 2 Platform
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.
It depends mostly on the type of parser they are using for reading web.xml file. if you use validating parser then it definately complains about ur non-conformance. if you use non-validating (as the name suggests) it never cares about the ordering or cordinality/optionality of the attributes Sridhar
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.
yes, SridharS I agree, this behavior I�ve said is with the defaul configuration for WL6.0 and 6.1. regards. 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).]
No holds barred. And no bars holed. Except this tiny ad: