Get the root dir of a web appTag(s): Servlet/JSP Servlet/JSP

In a JSP
String path = application.getRealPath("/");
In a Servlet
String path = getServletContext.getRealPath("/");



If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2012
[ home ]