SERVLET working directory

I am working a servlet file. Any method to retrieve my current working directory?As what I understand this could be done easily at JSP by using :application.getRealPath(".");Thanks
[208 byte] By [leejeoka] at [2007-11-27 9:06:38]
# 1

Do the same thing in your servlet too? What's the problem?

application is a pre-defined reference to the servlet context.

Use this:

ServletContext application = getServletContext();

application.getRealPath("/"); //will return the path to the folder as $CATALINA_HOME/webapps/myAppFolder ( if using Tomcat )

nogoodatcodinga at 2007-7-12 21:42:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
fantastic...thanks for the help.
leejeoka at 2007-7-12 21:42:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...