Link to home
Start Free TrialLog in
Avatar of Valeri
ValeriFlag for Bulgaria

asked on

How to change working directory in Tomcat

Hi all,

How to change working directory in Tomcat? Currently from my JSP I'm creating file and after that I'm finding this file in TOMCAT_HOME/bin, but I don't want to be there, I would like to be in my ROOT directory!
I know that I have to write something in web.xml or server.xml, but I don't know what exactly?!?!
Is there anybody that knows how to change my working directory?
Please write the lines that I have to add to this xml files in order to change my working directory!
Thanks in advance!
Avatar of Valeri
Valeri
Flag of Bulgaria image

ASKER

All that I need is to create this file in my Root directory. How to get the root directory and to create the file in this directory?
ASKER CERTIFIED SOLUTION
Avatar of petmagdy
petmagdy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hehehe...  darn ;-)
Avatar of Valeri

ASKER

Only getServletContext().getRealPath( "." ) doesn't works...  "getServletConfig()" must be added in front. But what actually retruns this "getServletConfig()" ?!?!
All JSPs are compiled into servlets, and getServletConfig() is a method of HttpServlet :-)

Hope it's all working!

Good luck!

Tim