How to get tomcat installtion path, java path n documents path in a servlet
may someone help me get the folder and pathname for tomcat, java path and library path and also the pathname where the jsp documents are stored.
Thanks in advance
null
may someone help me get the folder and pathname for tomcat, java path and library path and also the pathname where the jsp documents are stored.
Thanks in advance
null
Have a look at System.getEnv(String) and System.getProperties();
String tomcatHome = System.getEnv("CATALINA_HOME");
Properties props = System.getProperties();
Enumeration<Object> keys = props.keys();
while(keys.hasMoreElements())
{
String key = (String) keys.nextElement();
String prop = System.getProperty(key);
System.out.println(key +" : " + prop);
}