aspose file tools
The moose likes Tomcat and the fly likes how to specify relative path to a file in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Tomcat
Reply locked New topic
Author

how to specify relative path to a file in tomcat

Prasath Premkumar
Ranch Hand

Joined: Nov 13, 2008
Posts: 43
Hi,

I'v really stuck with an issue. I have done a web program using struts framework. I have a plugin class there for which i have to pass a configuration file as parameter. That file is in webapps/Myapp/WEB-INF/ directory. So i mentioned relative path as ../webapps/Myapp/WEB-INF/conf.xml. it works fine if i download tomcat zip file & extract it & use. Bt if i download a .exe file (eg: Apache-tomcat-5.5.15.exe) & run it to install & use it, struts doesnt get that path.

I'm really stuck with this prob. i need a way to specify path which works for both tomcat installations.

Please help me to solve this prob.

Note:
I thought to check where a file creates if i create a file from my program. When the tomcat.zip is used i found the created test file is in bin directory of tomcat. That means tomcat defaultly points to bin directory, so the path to the config file ../webapps/Myapp/WEB-INF/conf.xml. works fine.
When i used tomcat.exe & installed tomcat in my machine & run the program,i found that the test file i created in my code level was in windows/system32/ directory. so in this case tomcat doesnt defaultly points to the bin directory i guess.

hope this helps to give me a good answer.
Thanks in advance.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8263

Please do not post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
CarefullyChooseOneForum


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to specify relative path to a file in tomcat
 
Similar Threads
Customize 404 errors in Apache Tomcat
Enabling cgi scripts on Tomcat
unable to execute
path problem
Configuring Tomcat...