Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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

Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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???

It will be a lot helpful if you can shed some light on this??

Pavan Kumar Tammana
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just a comment; sometimes those mock exams they just add questions that aren't really in the spec.
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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:


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.
Legend has it that if you rub the right tiny ad, a genie comes out.
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic