wood burning stoves 2.0*
The moose likes Struts and the fly likes How to determine TOMCAT_HOME from within a Servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to determine TOMCAT_HOME from within a Servlet?" Watch "How to determine TOMCAT_HOME from within a Servlet?" New topic
Author

How to determine TOMCAT_HOME from within a Servlet?

dave sag
Ranch Hand

Joined: Feb 17, 2003
Posts: 47
Hi there. My servlet needs a reliable way of determining it's base path, ie the path to its folder in tomcat's webapp directory. is there a simple, container independent way of doing this?


JSF / Jini / Javaspaces / JDO - all rock in my opinion.
Srikanth Shenoy
author
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
I am not a Tomcat expert, but certainly there is no way of getting the TOMCAT_HOME.
You might have to set a System Property yourself and access in the web tier code or set Servlet Init parameter or a JNDI environment entry.
Srikanth
Author: Struts Survival Guide - Basics to Best Practices


Srikanth Shenoy
Author of Struts Survival Guide : Basics to Best Practices
 
 
subject: How to determine TOMCAT_HOME from within a Servlet?