| Author |
ordering of env-entry sub elements
|
Tridib Samanta
Ranch Hand
Joined: Apr 28, 2004
Posts: 128
|
|
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.
|
Thanks, Tridib
SCJP 1.4, SCWCD 1.4, SCBCD 5.0
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
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.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
|
Can we expect such questions in the actual exam??
|
SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
|
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.
|
 |
 |
|
|
subject: ordering of env-entry sub elements
|
|
|