Hi all, Can anyone tell me the order of elements we declare in deployment descriptor? I actually thought that the order doesn't matter. But when i was doing the mock exams i have seen some questions on this. I am actually using a SWT(Standard Web Toolkit) a plug-in for eclipse. Normally the tool alerts me if the order in web.xml is not correct, because it has the reference to the xsd in the deployment descriptor and i guess the validation is done by referring to the xsd. HFSJ book also doesn't talk anything regarding this. I looked into specs as well, but no where was the order was mentioned So can anyone help me with this???
Bates/Kathy/Bryan, It will be a lot helpful if you can shed some light on this??
it doesn't help to post the same question twice. Anyhow, to answer your question again - the order of elements doesn't matter in a 2.4 descriptor. You can verify this for yourself by reading the documentation contained in the Schema definition itself, which you can find at:
The web-app element is the root of the deployment descriptor for a web application. Note that the sub-elements of this element can be in the arbitrary order. Because of that, the multiplicity of the elements of distributable, session-config, welcome-file-list, jsp-config, login-config, and locale-encoding-mapping-list was changed from "?" to "*" in this schema. However, the deployment descriptor instance file must not contain multiple elements of session-config, jsp-config, and login-config. When there are multiple elements of welcome-file-list or locale-encoding-mapping-list, the container must concatinate the element contents. The multiple occurance of the element distributable is redundant and the container treats that case exactly in the same way when there is only one distributable.
As I mentioned previously, for the 2.3 descriptor, order was important, and there are still lots of mock questions floating around which are based on the 2.3 spec.
Hope that helps.
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
a bit of art, as a gift, the permaculture playing cards