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:
- JBoss 4.0.5.GA
- Redhat EL 4
- jdk 1.5.0
See here for the javadoc