On Apr 6, 2005 10:07 PM, Jeanfrancois Arcand
<[EMAIL PROTECTED]> wrote:
> 
> 
> N G wrote:
> > On Apr 6, 2005 10:31 AM, Jeanfrancois Arcand <[EMAIL PROTECTED]> wrote:
> > 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?

Yes, I do. Try this header in your web.xml in Tomcat 5.5.7 and the app
will deploy with no problems:
<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 whatever"
       version="2.4">

Now, while I don't really have another 2.4 compliant server to try
this on right now, EVEN ACCORDING TO YOU (as you correctly pointed out
in the spec.), another server HAS THE RIGHT to validate this file
however it wants. So, it might choose to validate it by actually
paying attention to the schema location specified. Thus, the above
declaration will fail and is therefore NOT portable!

Am I wrong?

Thanks,
NG.

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

Reply via email to