Accessing XML files from a WebApp
1 posts in topic
Flat View  Flat View

Posted By:   Ahmed_MAS
Posted On:   Wednesday, October 26, 2005 01:53 PM

I have a webApp that contains classes which access to XML files in a directory. Now I'm using a non relative adress like c:xml_files or /home/mas/xml_files.
but I want to use a relative adress to access these files like /xml_files from my java class in WEB_INF/classes. and all of that are under the webApp's directory under Tomcat/webapps.

this request is to make the webApp fully portable.

Thanks for your help

Re: Accessing XML files from a WebApp

Posted By:   Anthony_R  
Posted On:   Thursday, October 27, 2005 09:11 PM

Some say put your config files as close the class using it. However, WEB-INF or WEB-INF/conf is good. It's part of he classpath so it would get picked. You could also embed the xml files in a jar file and have the class read it relative to package.
About | Sitemap | Contact