How do I find out Tomcat's home directory from inside a running servlet?

Alessandro A. Garbagnati

When Tomcat is executed (and you can check both and tomcat.bat in the tomcat's bin directory) the property 'tomcat.home' is set using -D. This means that you should be able to access it using System.getProperty("tomcat.home").

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact