Hello,
I have an XML file which I need to read and load the data in memory every time the app launches. So, while the project was in Eclipse, i hardcoded the path: "/path/to/xml" but when I create the WAR, how can I specify the relative path to the XML file.
I can do it using URL url = getServletContext().getResource(fileName);
But, I don't have the servlet context available to me, since it's just a Config loader class.
Thanks
UPDATE:
I did this, was the simplest approach:
URL urlOfXml =
Thread.currentThread().getContextClassLoader().getResource("ConfigXmlFile.xml");