Can someone explain what are the requirements for a j2ee application server
regarding the "working directory" of an application (the application
context)?
I have a servlet who read a config file and first time when I wrote the code
I did something like:
String path = new File("").getAbsolutePath()
in order to obtain the path to the root of my application and then append a
relative path: "META-INF/config.xml" to get an absolute location of a config
file.
But the path string is always "/opt/orion". Seems like it is easy to list
the config dir and another applications directories.
Now I found the right way to get my config file: getResourceAsStream(), and
I found that
new File("").getAbsolutePath() is the same with
System.getProperties().getProperty("user.dir")
but the question still remains: it is ok to obtain path="/opt/orion" and
not the path to my application in a j2ee server ?
Thanks,
Florin