You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Dr. Edward R. Jones" <ej...@falcon.tamucc.edu> on 2002/07/10 10:25:54 UTC

Where to place XML Schemas in Tomcat?

Hi,

I need to read .xsd (schemas) for xerces validation under tomcat.  How do 
I get tomcat to look for them in a directory like WEB-INF/schemas ?  
Currently, tomcat is looking for them in the root of the main drive (under 
windows 2K professional).

Thanks for your help - edwardJones

-- 
****************************************************************************
 Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
 Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840 
****************************************************************************


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Where to place XML Schemas in Tomcat?

Posted by Jacob Kjome <ho...@visi.com>.
Try,

  InputStream is = 
getServletContext().getResourceAsStream("/WEB-INF/Schemas/MySchema.xml");


This will work whether the webapp is deployed as a directory on the file 
system or as a .war file.

Jake

At 05:31 AM 7/10/2002 -0500, you wrote:
>Yes, that seems to be the case.  The problem is that I'm validating
>arbitrary xml files using namespaces, and the schema locations specified
>in those files are relative to the application directory.  In other
>words, xerces is expecting to find them in the same directory as the
>class file, which does not work with tomcat.
>
>I was hoping that I could use either server.xml or web.xml entries to
>point to the location of these files.  What is the "best" documentation
>(most complete) for those files?
>
>Thanks - edwardJones
>On Wed, 10 Jul 2002, Andrew Conrad wrote:
>
> > I'm not positive, but I was under the impression that you cannot see
> > inside the WEB-INF folder.
> >
> > I would just create a new folder in the root of your app and reference
> > them absolutely "/Schemas"
> >
> > - Andrew
> >
> > -----Original Message-----
> > From: Dr. Edward R. Jones [mailto:ejones@falcon.tamucc.edu]
> > Sent: Wednesday, July 10, 2002 4:26 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Where to place XML Schemas in Tomcat?
> >
> >
> > Hi,
> >
> > I need to read .xsd (schemas) for xerces validation under tomcat.  How
> > do
> > I get tomcat to look for them in a directory like WEB-INF/schemas ?
> > Currently, tomcat is looking for them in the root of the main drive
> > (under
> > windows 2K professional).
> >
> > Thanks for your help - edwardJones
> >
> >
>
>--
>****************************************************************************
>  Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
>  Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840
>****************************************************************************
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

RE: Where to place XML Schemas in Tomcat?

Posted by "Dr. Edward R. Jones" <ej...@falcon.tamucc.edu>.
Yes, that seems to be the case.  The problem is that I'm validating 
arbitrary xml files using namespaces, and the schema locations specified 
in those files are relative to the application directory.  In other 
words, xerces is expecting to find them in the same directory as the 
class file, which does not work with tomcat.

I was hoping that I could use either server.xml or web.xml entries to 
point to the location of these files.  What is the "best" documentation 
(most complete) for those files?

Thanks - edwardJones
On Wed, 10 Jul 2002, Andrew Conrad wrote:

> I'm not positive, but I was under the impression that you cannot see
> inside the WEB-INF folder.
> 
> I would just create a new folder in the root of your app and reference
> them absolutely "/Schemas"
> 
> - Andrew
> 
> -----Original Message-----
> From: Dr. Edward R. Jones [mailto:ejones@falcon.tamucc.edu] 
> Sent: Wednesday, July 10, 2002 4:26 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Where to place XML Schemas in Tomcat?
> 
> 
> Hi,
> 
> I need to read .xsd (schemas) for xerces validation under tomcat.  How
> do 
> I get tomcat to look for them in a directory like WEB-INF/schemas ?  
> Currently, tomcat is looking for them in the root of the main drive
> (under 
> windows 2K professional).
> 
> Thanks for your help - edwardJones
> 
> 

-- 
****************************************************************************
 Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
 Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840 
****************************************************************************


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Where to place XML Schemas in Tomcat?

Posted by Andrew Conrad <an...@msn.com>.
I'm not positive, but I was under the impression that you cannot see
inside the WEB-INF folder.

I would just create a new folder in the root of your app and reference
them absolutely "/Schemas"

- Andrew

-----Original Message-----
From: Dr. Edward R. Jones [mailto:ejones@falcon.tamucc.edu] 
Sent: Wednesday, July 10, 2002 4:26 AM
To: tomcat-user@jakarta.apache.org
Subject: Where to place XML Schemas in Tomcat?


Hi,

I need to read .xsd (schemas) for xerces validation under tomcat.  How
do 
I get tomcat to look for them in a directory like WEB-INF/schemas ?  
Currently, tomcat is looking for them in the root of the main drive
(under 
windows 2K professional).

Thanks for your help - edwardJones

-- 
************************************************************************
****
 Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
 Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840 
************************************************************************
****


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>