• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ordering of env-entry sub elements

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Can anybody tell me whether the order of sub elemnts of env-entry in web.xml does matter?

Like, are the following two entry same?

<env-entry>
<env-entry-name>message</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-name>Hello!</env-entry-name>
</env-entry>



<env-entry>
<env-entry-name>message</env-entry-name>
<env-entry-name>Hello!</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>

I tried both of this example in tomcat 6. Both of them worked well. But the second example fails xsd validation. I am really confused.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As of version 2.4 of the spec, the env-entry element contains :
- optional description (zero or more)
- one mandatory env-entry-name
- one mandatory env-entry-type
- one optional env-entry-value

Your container may be a bit lenient on this. Just don't trust it, and write environment entries as described in the spec.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we expect such questions in the actual exam??
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think so. But you may have something about the env-entry tag itself. You have to know what it is used for.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic