• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bert/Bryan/Kathy - order of elements in web.xml

 
Pavan Kumar Tammana
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??

Thanks,
Pavan Kumar Tammana
 
Doyle Matt
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just a comment; sometimes those mock exams they just add questions that aren't really in the spec.
 
Daniel Dalton
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pavan

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:

web-app_2_4.xsd

But to give you the relevant extract:


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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic