Originally posted by Rohit Poddar:
2) Are there any more of such restrictions, as to which element comes before any other element?
Yes, it's all in the
DTD Specification . The specification for
<web-app> ...
<!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*, ejb-local-ref*)>
tells you what other elements can occur inside <web-app>. A question mark indicates that the item is optional, and a star means zero-or-more occurrences, however the elements (where they appear) must occur in the order given (indicated by the commas).
Hope that answers your question.