Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 60708 invoked from network); 24 Apr 2007 18:20:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Apr 2007 18:20:44 -0000 Received: (qmail 34201 invoked by uid 500); 24 Apr 2007 18:20:38 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 34176 invoked by uid 500); 24 Apr 2007 18:20:38 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 34165 invoked by uid 99); 24 Apr 2007 18:20:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Apr 2007 11:20:38 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [196.25.240.78] (HELO ctb-mesg8.saix.net) (196.25.240.78) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Apr 2007 11:20:30 -0700 Received: from animal (dsl-243-126-58.telkomadsl.co.za [41.243.126.58]) by ctb-mesg8.saix.net (Postfix) with SMTP id 0DB4231AF for ; Tue, 24 Apr 2007 20:20:05 +0200 (SAST) Message-ID: <002c01c7869d$32504fa0$0300000a@animal> From: "Johnny Kewl" To: "Tomcat Users List" References: <8d7255f30704240945u5b0e552cl2baa0b85af13ff9@mail.gmail.com> Subject: Re: linux + tomcat, some path/link problem Date: Tue, 24 Apr 2007 20:20:09 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-Antivirus: avast! (VPS 000730-2, 2007/04/03), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Ha ha.... boy of boy are you in for some pain... sorry cant help myself. Well yes, you need to convert... because MS just didnt have the decency to ask the linux guys how to do it ;) Heres a little code for you if(rawFileName == null) return ""; if(rawFileName.length() == 0) return ""; String s = rawFileName; s = s.replace('\\','/'); // make it unix compat s = s.trim(); String firstChar = s.substring(0,1); if(firstChar.compareTo("/") != 0){ s = "/" + s; something like that.... But this is why I'm talking to you.... have a look at file/// security restrictions on XP and later. They going to get blocked.... so after all that pain... IE is going to drive you mad.... ha ha. But I got some good news for you.... go to http://coolese.100free.com/ and download ESE... it does exactly that... its based on lucene and it allows you to search folders, and or dB's and then navigate the results in a browser. Have a look at how it navigates.... it doesnt use file/// it turns the directories into a URL and navigates through Tomcat.... to get around security issues. So yes I'm laughing coz I went through all this pain.... good luck. ----- Original Message ----- From: "Lu Rui" To: Sent: Tuesday, April 24, 2007 6:45 PM 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"); > > testlink > > 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