tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fargusson.Alan" <Alan.Fargus...@ftb.ca.gov>
Subject RE: linux + tomcat, some path/link problem
Date Tue, 24 Apr 2007 17:04:18 GMT
I may be completely miss-understanding, but I think this is a browser trick.  At least in IE7
when I have c: it assumes file:..., but when I don't have c: it assumes http:... .  You will
probably need to code file:///root/test.html (I may have the wrong number of / after file:)
to get this to work.

-----Original Message-----
From: Lu Rui [mailto:mcrayes@gmail.com]
Sent: Tuesday, April 24, 2007 9:46 AM
To: users@tomcat.apache.org
Subject: linux + tomcat, some path/link problem


hi, all,

     i'm writing a jsp front-end of a desktop search program in linux
using tomcat 5.5, here is my problem.

     say we need a result.jsp which can display the results from
lucene and show the related links, codes like below (hard-coding
for simple, as long as you can get my thougt is okay)

// for winxp
String filePath = new String("c:\\root\\test.html");


// for linux
String filePath = new String("/root/test.html");

<A href="<%= filePath %>"> testlink </A>

i've test this page both in winxp and linux. in windows,
right-click to check out the property of "testlink" you can see it
goes to " file:///c:/root:/test.html " and left-click then the browser
will open corresponding page, which is exactly what i've been
expecting.

but in linux here comes my trouble, i click "testlink" it
goes to "404 not found", then i check out its property and find it
leads to " http://localhost:8080/root/index.html ", it seems tomcat
took " /root " as a subdir of " /tomcat/webapps " and messed things up, totally
misunderstood my purpose.

as far as i know path is always a confusing problem of tomcat, but in
linux "/" stands for root of file system, so i'm clearly using an
abusolute path, why tomcat still made such mistake while it works well
in windows with " C:\\root\test.html" ?
and as mentioned above, this link, actually these links,
might go to anywhere in local file system, which makes the trouble
more complex, so i don't think setup Context or docBase or
relative-path could help much, i really need tomcat to be informed
that i'm using
abusolute path and i don't care it goes out of web project and that's
what i want.

plz help me out. thanks. and if what i said make you feel somehow offended,
it's not my bad feelings just my bad english..

while ( true ) {
 help me out;
}

regards.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message