• 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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

elements sequence in web.xml

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic