• 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

elements sequence in web.xml

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the servlet specification, i came to know that the order of top elements doesn't matter in web.xml i.e. we can have <servlet>,<servlet-mapping>,<security-constraint> in any order.
What about the inner tags of these elements ? does the sequence matters for inner tags?
Can we write like below:
<servlet>
<security-role-ref>
</role-name>
</role-link>
</security-role-ref>
<init-parm>
<parm-name>
<parm-value>
</init-parm>
<servlet-name>
<servlet-class>
</servlet>

Is this correct? If so,what is sequence rule for evaluataing web.xml.
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

From 1.4 version there is schema document for web.xml. The XML is evaluated according to the schema document.

Thanks
 
swapna rao
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you meant to say that the example which i gave is not correct as it doesn't follow the schema.But i found this sequence in one of the study notes of Java ranch site .This notes is uploaded by ashok.please anyone explain me.
 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I remember one of rancher told inner elements should be in order.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

As per Servlet version 1.4, the order of the inner elements are important. I had tested it long back. The tomcat did not complain about it. But the Sun Application Server give error if the elements are not in order. Then I check the schema document , I found that most of the inner elements enforced the sequence order.



Thanks
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic