tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lu Rui" <>
Subject linux + tomcat, some path/link problem
Date Tue, 24 Apr 2007 16:45:55 GMT
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

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;


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message