This content has been marked as final.
Show 5 replies
-
1. Re: Access config file from within WAR file?
wdfink Dec 21, 2010 9:25 AM (in response to brent87)You might use MyClass.class.getResourceAsStream(myFile) and pack the file into the classes folder.
-
2. Re: Access config file from within WAR file?
brent87 Dec 21, 2010 9:36 AM (in response to wdfink)So you're saying put the entire .war file in /classes? Or copy the config file into /classes? I'm trying not to do the ladder.
-
3. Re: Access config file from within WAR file?
wdfink Dec 21, 2010 10:25 AM (in response to brent87)1 of 1 people found this helpfulplace the config file in the WEB-INF/classes folder of you WAR.
In this case you should able to use the getResourceAsStream()
-
4. Re: Access config file from within WAR file?
brent87 Dec 21, 2010 7:07 PM (in response to wdfink)Thanks, I looked into that, but ended up using getServletContext().getRealPath(/WEB-INF/config.xml), as it was more in line with what my boss wanted.
-
5. Re: Access config file from within WAR file?
brent87 Dec 21, 2010 7:08 PM (in response to brent87)sorry, forgot the quotes: getServletContext().getRealPath("/WEB-INF/config.xml");