How to determine application root directory on the server

I've written a servlet that uses a local file directory on the server, which is under the application's root directory. Without hard coding this directory, how do I determine the applications root directory under the tomcat container path (from the server perspective), not as the client sees it?

Thanks,

Werner

[332 byte] By [reichewa] at [2007-11-26 15:58:32]
# 1
String realPath = ((ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext()).getRealPath("/");
BalusCa at 2007-7-8 22:19:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thank you.
reichewa at 2007-7-8 22:19:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...