RE: which is the current directory for Tomcat Server?
Hi There is a directory called work (jakarta-tomcat-4.0.1/work) under which a directory gets created for each context - where the servlets get run. Excactly how it works from there I'm not sure but you should be able to get to your file by using absolute addresses. Or perhaps by using a relative address of the form ../../webapps/yourappname/WEB-INF/classes/filename, but I'm not too sure. You could possibly find the location by making the servlet create a file called something like find.me and then issuing find / -name find.me. Jaco Hi, Thanks for the fast reply. What I want is to read a text file from servlet or jsp page. I don 't want to specify the whole directory path for the file. I want to just specify the file name and should be able to read that file. So I believe if I keep in the current working directory of the Tomcat server, it will work. IS the WEB root as same as the Current working directory for the Tomcat Server. Regards, Santosh -Original Message- From: Atok Koenig [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 3:54 PM To: Tomcat Users List Subject: Re: which is the current directory for Tomcat Server? Do you mean the web root? If so that is install path\jakarta-tomcat-3.2.2\webapps\ROOT Youcan change this or add additional virtual roots in the \config\server.xml file using the context tags -Original Message- From: Santosh Varghese [EMAIL PROTECTED] Date: Thu, 31 Jan 2002 14:37:21 -0800 To: Tomcat Users List [EMAIL PROTECTED] Subject: which is the current directory for Tomcat Server? Hi, I wanted to read some txt file from the current directory for tomcat server. But I am unable to find out the current directory. Please help me out Regards, Santosh -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: which is the current directory for Tomcat Server?
I believe the current directory will vary depending on how Tomcat is started. Using getRealPath(), which gives you the path of the webapp's base directory, will be much more reliable. Cheers, Larry -Original Message- From: timothy [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 11:38 PM To: Tomcat Users List Subject: Re: which is the current directory for Tomcat Server? %TOMCAT_HOME%\bin From Timothy - Original Message - From: Santosh Varghese [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, February 01, 2002 6:37 AM Subject: which is the current directory for Tomcat Server? Hi, I wanted to read some txt file from the current directory for tomcat server. But I am unable to find out the current directory. Please help me out Regards, Santosh -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
which is the current directory for Tomcat Server?
Hi, I wanted to read some txt file from the current directory for tomcat server. But I am unable to find out the current directory. Please help me out Regards, Santosh -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: which is the current directory for Tomcat Server?
Do you mean the web root? If so that is install path\jakarta-tomcat-3.2.2\webapps\ROOT Youcan change this or add additional virtual roots in the \config\server.xml file using the context tags -Original Message- From: Santosh Varghese [EMAIL PROTECTED] Date: Thu, 31 Jan 2002 14:37:21 -0800 To: Tomcat Users List [EMAIL PROTECTED] Subject: which is the current directory for Tomcat Server? Hi, I wanted to read some txt file from the current directory for tomcat server. But I am unable to find out the current directory. Please help me out Regards, Santosh -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- ___ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Win a ski trip! http://www.nowcode.com/register.asp?affiliate=1net2phone3a -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: which is the current directory for Tomcat Server?
Hi, Thanks for the fast reply. What I want is to read a text file from servlet or jsp page. I don 't want to specify the whole directory path for the file. I want to just specify the file name and should be able to read that file. So I believe if I keep in the current working directory of the Tomcat server, it will work. IS the WEB root as same as the Current working directory for the Tomcat Server. Regards, Santosh -Original Message- From: Atok Koenig [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 3:54 PM To: Tomcat Users List Subject: Re: which is the current directory for Tomcat Server? Do you mean the web root? If so that is install path\jakarta-tomcat-3.2.2\webapps\ROOT Youcan change this or add additional virtual roots in the \config\server.xml file using the context tags -Original Message- From: Santosh Varghese [EMAIL PROTECTED] Date: Thu, 31 Jan 2002 14:37:21 -0800 To: Tomcat Users List [EMAIL PROTECTED] Subject: which is the current directory for Tomcat Server? Hi, I wanted to read some txt file from the current directory for tomcat server. But I am unable to find out the current directory. Please help me out Regards, Santosh -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- ___ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Win a ski trip! http://www.nowcode.com/register.asp?affiliate=1net2phone3a -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: which is the current directory for Tomcat Server?
use getRealPath(); method - Original Message - From: Santosh Varghese [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, February 01, 2002 08:16 Subject: RE: which is the current directory for Tomcat Server? Hi, Thanks for the fast reply. What I want is to read a text file from servlet or jsp page. I don 't want to specify the whole directory path for the file. I want to just specify the file name and should be able to read that file. So I believe if I keep in the current working directory of the Tomcat server, it will work. IS the WEB root as same as the Current working directory for the Tomcat Server. Regards, Santosh -Original Message- From: Atok Koenig [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 3:54 PM To: Tomcat Users List Subject: Re: which is the current directory for Tomcat Server? Do you mean the web root? If so that is install path\jakarta-tomcat-3.2.2\webapps\ROOT Youcan change this or add additional virtual roots in the \config\server.xml file using the context tags -Original Message- From: Santosh Varghese [EMAIL PROTECTED] Date: Thu, 31 Jan 2002 14:37:21 -0800 To: Tomcat Users List [EMAIL PROTECTED] Subject: which is the current directory for Tomcat Server? Hi, I wanted to read some txt file from the current directory for tomcat server. But I am unable to find out the current directory. Please help me out Regards, Santosh -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- ___ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Win a ski trip! http://www.nowcode.com/register.asp?affiliate=1net2phone3a -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: which is the current directory for Tomcat Server?
in jsp page use application.getRealPath(/webapps); in Servlet use config.getServletContext().getRealPath(/webapps); - Original Message - From: Santosh Varghese [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, February 01, 2002 06:37 Subject: which is the current directory for Tomcat Server? Hi, I wanted to read some txt file from the current directory for tomcat server. But I am unable to find out the current directory. Please help me out Regards, Santosh -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: which is the current directory for Tomcat Server?
Hi, This will solve the problem of getting the full real path of the directory '/webapps' only. I wanted to know which is the directory from which the tomcat server executes, so that when I say just File.open(filename.txt) should work. I should be able to read the contents of filename.txt. I hope u got my problem. Regards, Santosh -Original Message- From: Galbayar [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 5:26 PM To: Tomcat Users List Subject: Re: which is the current directory for Tomcat Server? in jsp page use application.getRealPath(/webapps); in Servlet use config.getServletContext().getRealPath(/webapps); - Original Message - From: Santosh Varghese [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, February 01, 2002 06:37 Subject: which is the current directory for Tomcat Server? Hi, I wanted to read some txt file from the current directory for tomcat server. But I am unable to find out the current directory. Please help me out Regards, Santosh -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: which is the current directory for Tomcat Server?
%TOMCAT_HOME%\bin From Timothy - Original Message - From: Santosh Varghese [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, February 01, 2002 6:37 AM Subject: which is the current directory for Tomcat Server? Hi, I wanted to read some txt file from the current directory for tomcat server. But I am unable to find out the current directory. Please help me out Regards, Santosh -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]