The JavaRanch exam is based on old spec J2EE 1.3. So the DD for this spec require specific order of sub-elements. That is the listener definations should come before servlet definations. That is why the parse error. For J2EE 1.4 there is order restrictions for sub-elements of <web-app>
I have tried interchanging thr order of sub-elements of sub-elements of web-app.It didnt give me any problem.
I think we have discussed little bit on this in your previous post.
I also created a sample application by interchanging the order of sub-elements of sub-elements of web-app. The .war I deployed in tomcat 5.5.7. It is working fine. But When I tried to deploy on Java Application Server8.1 UR2 it doesn't allow me to deploy the .war due to this interchanging.
The specification clearly says that such interchaging is not allowed (error). and the Reference implementation of Java Application Server8.1 UR2 behaves the same. So the exam point of view, we should consider that the order of sub-elements of sub-element of <web-app> is important.
I am using NetBean IDE to test the web.xml. It also give the XML validation error, if I try to validate the web.xml file.
Correct me, if my assumption is not right.
Joined: Nov 15, 2004
The specification clearly says that such interchaging is not allowed (error)
I like to know the page number of the spec.
The sub elements under web-app can be in an arbitrary order in this version(2.4 of the specification.
Nothing has been mentioned about the order of sub-elements of sub elements under web-app element.
This can be conformed under a high-end application server like weblogic (or) websphere. [ November 22, 2005: Message edited by: Vishnu Prakash ]