http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom.htm
Best, -FB
On Wednesday, March 12, 2003, at 12:53 AM, Dan Tran wrote:
Sorry I dont have an example for you, but all you need is a InputStream to
your xml file in your war file. Here is the interface to get it
InputStream is = servlet.getServletContext().getResourceAsStream(pathName);
Hope it helps
-Dan
----- Original Message ----- From: "Francisco J. Bido" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, March 11, 2003 10:45 PM Subject: Reading an XML File From a Servlet
Hi,
I have a controller servlet which reads its configuration information from an xml file. I can do this relative to my local file system. My question is how to get the servlet to read the xml file from the WEB-INF directory once packaged in a typical WAR file.
I'm lost regarding what the steps to follow or where to find a good example on how to achieve this. For example, do I need to declare a resource in the webapp's web.xml? Any help appreciated.
Thanks! -FB
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
