N G wrote:
On Apr 6, 2005 10:31 AM, Jeanfrancois Arcand <[EMAIL PROTECTED]> wrote:

Tomcat uses it's own local version. This way you can use Tomcat without
being connected to the internet, or pay the price of connection over
http everytime a war is deployed.


And what's WAY more important: what does the servlet spec say about
how a server should validate web.xml?

See the Servlet Spec.

SRV.13.2         Rules for Processing the Deployment Descriptor
This section lists some general rules that Web containers and developers must 
note
concerning the processing of the deployment descriptor for a Web application.
· Web containers must remove all leading and trailing whitespace, which is de-
  fined as "S(white space)" in XML 1.0 (http://www.w3.org/TR/2000/WD-xml-
  2e-20000814), for the element content of the text nodes of a deployment de-
  scriptor.
· The deployment descriptor must be valid against the schema. Web containers
  and tools that manipulate Web applications have a wide range of options for
  checking the validity of a WAR. This includes checking the validity of the de-
  ployment descriptor document held within. The containers and tools that are
  part of J2EE technology-compliant implementation are required to validate
  deployment descriptor against the XML schema for structural correctness.
  The validation is recommended, but not required for the web containers and
  tools that are not part of J2EE technology-compliant implementation.


Yes, I saw this. However, what gives a PORTABLE application the right
to specify a relative URL for the location of the Schema and not
provide that schema there? I don't see anything in this paragraph that
says this is allowed.

Are you seeing something that says is not allowed ;-)


SO, are you saying that even though Tomcat will accept whatever you put for the path to the Schema (since it uses its own copy), the app will not necessarily be portable to other servers since they might choose to actually pay attention to the schema location specified by web.xml?

So, to guarantee that the app is 100% portable, you must specify:

<web-app xmlns="http://java.sun.com/xml/ns/j2ee";
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xsi:schemaLocation=
      "http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
      version="2.4">


Am I correct?

We use SAX when parsing/validating the web.xml, and at the time we resolve the XML entity, we use the system ID to redirect the stream to our internal version. So if you don't have everything required in your <web-app ..> element, then it will fail because the parser (unfortunalty we use buggy Xerces ;-)) will not be able to create properly its schema table, unless you are connected to the internet and we are able to resolve the uri.


So I don't see why your app deployed/validated in Tomcat will not be portable. Do you have a test case?

Thanks

-- Jeanfrancosi


Thanks, NG.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to