Actually, this doesn't work either. getContextPath returns the part of the
URL that corresponds to the Context.
Assuming that you are using a file-based context, and you can control how
the app is deployed (i.e. it is always deployed under webapps), then this
might be one of the few real uses
Actually you asked for the home directory so you could use
http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.html#getContextPath()
Mark Shifman wrote:
You could try
http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.
You could try
http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.html#getResource(java.lang.String)
or
http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.html#getResourceAsStream(java.lang.String)
mas
Ar5eNiC wrote