Hello all.
Is it possible to get the path at which my application root is placed
by means of either the ServletContext or the ServletConfig object?
What I am trying to do here is to dynamically create a Javascript file
on the fly and put in the script directory of my web application. But
since the working directory in a web applications case is the
directory which contains the app servers' executable, any new file
created would be created there and I don't want to hard code the path
to my script folder. I want everything to be relative to the
applications' root as far as possible.
Can it be done without any special configuration, the way I can get a
resource present in the application root by the getResource() method?
Any kind of help would be greatly appreciated.
Regards,
sasuke.
Andrew Thompson - 11 Dec 2007 23:58 GMT
...
>Is it possible to get the path at which my application root is placed
>by means of either the ServletContext or the ServletConfig object?
<http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.ht
ml#getRealPath(java.lang.String
)>

Signature
Andrew Thompson
http://www.physci.org/
sasuke - 12 Dec 2007 15:11 GMT
> ..
>
[quoted text clipped - 3 lines]
> <http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/Servle...
> )>
Thank you, really appreciated.