Re: Can I read file resources from a .WAR file at runtime ?

2003-10-14 Thread Bill Barker
Justin's suggestion works, but personally I prefer using: InputStream is = getServletContext().getResourceAsStream(/WEB-INF/myresource); Steph Richardson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a web-app that uses several xml, xsd, and other configuration files at

RE: Can I read file resources from a .WAR file at runtime ?

2003-10-14 Thread Shapira, Yoav
14, 2003 2:14 AM To: [EMAIL PROTECTED] Subject: Re: Can I read file resources from a .WAR file at runtime ? Justin's suggestion works, but personally I prefer using: InputStream is = getServletContext().getResourceAsStream(/WEB-INF/myresource); Steph Richardson [EMAIL PROTECTED] wrote in message

RE: Can I read file resources from a .WAR file at runtime ?

2003-10-14 Thread Justin Ruthenbeck
At 05:45 AM 10/14/2003, you wrote: Howdy, Yeah, I usually prefer ServletContext#getResource or getResourceAsStream over the Class loader approach (Justin's suggestion) as well. Yoav Shapira Millennium ChemInformatics Both are definitely good options ... I prefer to go directly to the Classloader

Re: Can I read file resources from a .WAR file at runtime ?

2003-10-13 Thread Justin Ruthenbeck
Instead of referencing the files through classes in the the java.io packages, read the files as resources through the Classloader. This is a *much* preferable way to do what you asking about -- one very good reason for doing it through the Classloader is the dilema you're facing now. So to