Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

web.xml elements

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is the order of elements in xml imortant?
i mean is this valid??
<context-param>
<param-value>....</param-value>
<param-name>...</param-name>
</context-param>


one more ques...
if u want to give more than one context param.how would u declare it?
<context-param>
<param-name>...</param-name>
<param-value>....</param-value>
</context-param>
<context-param>
<param-name>...</param-name>
<param-value>....</param-value>
</context-param>

or
<context-param>
<param-name>...</param-name>
<param-value>....</param-value>

<param-name>...</param-name>
<param-value>....</param-value>
</context-param>

what about listeners?
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.I don't know whether the order is sensitive, sorry.

2.if there more than one context init parameter, you should write like this:
<context-param>
<param-name>...</param-name>
<param-value>....</param-value>
</context-param>

<context-param>
<param-name>...</param-name>
<param-value>....</param-value>
</context-param>

one by one.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am preparing for the SCWCD exam and had the same question. According to section SVR.13.2 of the Java Servlet Specification version 2.4, "the sub elements under web-app can be in any arbitrary order in this version of the specification". As far as the order of the context-param element, the XML Schema declares the context-param element to be of type param-valueType which lists the elements in the order <param-name> followed by <param-value>. So, if the Deployment Descriptor where validated against the XML Schema, the following would be valid:

<context-param>
<param-name>test</param-name>
<param-value>TestParam</param-value>
</context-param>

and the following would be invalid:

<context-param>
<param-value>TestParam</param-value>
<param-name>test</param-name>
</context-param>
 
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic