• 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

ordering of env-entry sub elements

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • 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
  • 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: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic