File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Web deployment description problem (DTD) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Web deployment description problem (DTD)" Watch "Web deployment description problem (DTD)" New topic
Author

Web deployment description problem (DTD)

Michael Santosa
Greenhorn

Joined: Mar 13, 2002
Posts: 19
Dear Ranchers,
The DTD of web-resource-collection is :
(web-resource-name, description?, url-pattern*,
http-method*)
I have an example :
<web-resource-collection>
<web-resource-name>Name</web-resource-name>
<url-pattern>/servlet/*</url-pattern>
<description>No Description</description>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
Unfortunaly, this sample doesn't work with
Tomcat 4.0..
but this is working fine :
<web-resource-collection>
<web-resource-name>Name</web-resource-name>
<description>No Description</description>
<url-pattern>/servlet/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
The different is only the location of description
tag, that must be written after (web-resource-name).
So it means that we have to be carefull about
the location of each tag ??
Thank you..
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Yes. Although most application servers are very lenient, an XML file is order sensitive and the DTD does impose the order in which the elements must appear. The exam may well contain questions about this.
- Peter
Michael Santosa
Greenhorn

Joined: Mar 13, 2002
Posts: 19
Thanks for the reply. It seems I have to memorize a lot of things again... :*
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Web deployment description problem (DTD)