relative path in tomcat

T

Taki

Hello,

I have Tomcat 4.1.24 running on my server.
I have modified my conf/server.xml so that
my docBase is not webapps/. So, my
docBase is like:
<Context ... docBase="/home/me/...../myweb" .... >

Now, I have a bean accessing a remote file,
but in the jsp file that locates in the same
directory as "file.txt", it doesn't recognize the relative path
(i.e. File f = new File("file.txt"); and
f.exists() returns false).

Though, if I enter the absolute path,
(i.e. File f= new File("/home/me/..../file.txt");)
then it works.

My questions is: if I put the relative path in the
File constructor, where does it point at?

Thanks in advance

Taki
 
A

Andrea Spinelli

Taki's fingertips typed this text:
Hello,

I have Tomcat 4.1.24 running on my server.
My questions is: if I put the relative path in the
File constructor, where does it point at?

Since this is not really a Java question,
I will only suggest that you launch
the shell command
"pwd > /tmp/whereAmI"
from within your program, and observe
the result with /bin/cat.

Galileo died in vain, eh?
 
J

John C. Bollinger

Andrea said:
Taki's fingertips typed this text: [...]
My questions is: if I put the relative path in the
File constructor, where does it point at?


Since this is not really a Java question,
I will only suggest that you launch
the shell command
"pwd > /tmp/whereAmI"
from within your program, and observe
the result with /bin/cat.

Galileo died in vain, eh?

It would probably be easier and more portable to examine the "user.dir"
System property.


John Bollinger
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,294
Latest member
LandonPigo

Latest Threads

Top