File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ordering of env-entry sub elements

 
Tridib Samanta
Ranch Hand
Posts: 128
  • 0
  • 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.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • 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.
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we expect such questions in the actual exam??
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic