This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Order significant in deployment descriptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Order significant in deployment descriptor" Watch "Order significant in deployment descriptor" New topic
Author

Order significant in deployment descriptor

Sekhar Kadiyala
Ranch Hand

Joined: Feb 17, 2004
Posts: 170
I have read somewhere that order of elements is significant in deployment descriptor.
Is that information available on net? Can someone please send me a link to that?

Also, where can i go browse the 1.3 related JSP and Servlet specifications?

Thnaks in advance!


PMP CSQA SCJP SCWCD SCBCD INS 21 INS 23
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
The order of elements sometimes *is* significant in 1.3, but does *not* matter with 1.4.
Sekhar Kadiyala
Ranch Hand

Joined: Feb 17, 2004
Posts: 170
Thank you, Kathy.

Would it be fair, if i assume that the web-app element definition thats given in dtd contains the order?

<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, filter*, filter-mapping*, listener*, servlet*,
servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>

Can we assume this order?
Lakshmi Rama
Greenhorn

Joined: Sep 01, 2004
Posts: 6
Originally posted by Sekhar Kadiyala:
Thank you, Kathy.

Would it be fair, if i assume that the web-app element definition thats given in dtd contains the order?

<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, filter*, filter-mapping*, listener*, servlet*,
servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>

Can we assume this order?



The order defined in DTD should be taken into consideration. Becoz thats a basic XML rule. The order in which the elements appear in the ELEMENT TAG should be obeyed by the xml documents uses that DTD for validation.

Kathy can you give reason for the order applied in 1.3 and not in 1.4.

IF web.xml of scwcd 1.4 follows a specific dtd. It has to follow the xml rules correct ?

Thanks,

RAMA.
Bryan Basham
author
Ranch Hand

Joined: Apr 30, 2001
Posts: 199
Originally posted by Lakshmi Rama:

The order defined in DTD should be taken into consideration. Becoz thats a basic XML rule. The order in which the elements appear in the ELEMENT TAG should be obeyed by the xml documents uses that DTD for validation.

This statement is true about an XML file using a DTD for validation, but this is not necessarily true for an XML file that uses a Schema for validation.

Kathy can you give reason for the order applied in 1.3 and not in 1.4.

The web-app XML structure in servlet v2.4 (J2EE v1.4) uses a Schema in which the order of the elements is not validated. Therefore, the XML parsers for the DD do not validate order.
[/QB]


HTH,
Bryan
Lakshmi Rama
Greenhorn

Joined: Sep 01, 2004
Posts: 6
Originally posted by Bryan Basham:


HTH,
Bryan


Thank you Bryan...

Your answers definitely helped me understand the difference better.

Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
In Servlet 2.3, the scheme is defined using DTD, which is order dependent.

In Servlet 2.4, the scheme is defined using XSD, which is order independent.

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Order significant in deployment descriptor