Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 32697 invoked from network); 4 Oct 2004 13:36:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 4 Oct 2004 13:36:07 -0000 Received: (qmail 50606 invoked by uid 500); 4 Oct 2004 13:35:31 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 50571 invoked by uid 500); 4 Oct 2004 13:35:31 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 50555 invoked by uid 99); 4 Oct 2004 13:35:30 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=FROM_ENDS_IN_NUMS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [212.237.188.45] (HELO mail1.ikasths.int) (212.237.188.45) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 04 Oct 2004 06:35:30 -0700 Received: from mail.ikasths.dk ([212.237.188.3]) by mail1.ikasths.int with Microsoft SMTPSVC(6.0.3790.0); Mon, 4 Oct 2004 15:35:20 +0200 Received: from [10.0.90.34] ([212.237.188.45]) by mail.ikasths.dk (Post.Office MTA v3.5.2 release 221 ID# 0-62113U3000L300S0V35) with ESMTP id dk for ; Mon, 4 Oct 2004 15:50:42 +0200 Message-ID: <41615145.3080403@mail.ikasths.dk> Date: Mon, 04 Oct 2004 15:33:57 +0200 From: dmu2201@mail.ikasths.dk (dmu2201) User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: da, en-us, en MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Howto read files Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Oct 2004 13:35:20.0989 (UTC) FILETIME=[FE8D44D0:01C4AA16] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi ML.... I'm having a problem with tomcat because I would like to read a certain XML file in a 'data' dir. The problem is that the relative path does not work: new File("data/questionnaires.xml/"); does not give the file since Tomcat is started from its bin dir and not from my /webapps/PROJECT dir. How do I, in a "nice" manner access that file with, hopefully, a relative path. I need a relative path or some kind of 'property' that enables me to access the file, independent of operating system. I have tried to use a in a context.xml file in a META-INF dir, but no luck :-( My dir structure: /webapps --/PROJECT --/data <---The dir I want to access --/WEB-INF/ --/WEB-INF/src --/WEB-INF/classes --/displayQuestionnaires/ ----/*.jsp Hope someone can help... Claus --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org