Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to determine TOMCAT_HOME from within a Servlet?

 
dave sag
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Srikanth Shenoy
author
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic