I have the following snippet of code:
String path = servletContext.getRealPath("/");
Now I got a bugreport from a user saying that the returned path is not an absolute path.
The returned path is 'usr/local/...' instead of '/usr/local/...' , so getRealPath seems to be returning a relative path.
I can see this, because the returned path is logged into a logfile.
My specs are:
See here for the javadoc
Something like
String path = new File(servletContext.getRealPath("/")).getAbsolutePath();
should solve your problem. (It does not answer your Question though...;-) )
Regards, Jan
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With