Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 34665 invoked from network); 9 Aug 2006 02:28:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Aug 2006 02:28:34 -0000 Received: (qmail 54258 invoked by uid 500); 9 Aug 2006 02:28:22 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 54230 invoked by uid 500); 9 Aug 2006 02:28:22 -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 54218 invoked by uid 99); 9 Aug 2006 02:28:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 19:28:22 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ampyx.li@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nf-out-0910.google.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 19:28:21 -0700 Received: by nf-out-0910.google.com with SMTP id q29so57561nfc for ; Tue, 08 Aug 2006 19:27:55 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=GCSrta1DInU7ZiIuoK0DC4aoRBkG3mnCQD2jWfVDOcEEMBbMdPl++pHqy64YwhNRX1ZD6gbKFiE097Lbx+YPurGOB6sou9IYwcH7kScZB65p5vuePFyqYVcPbiFDayi74pSGx539M/tSJPs2i+Ek/KwFP/UU0g71SoPaPkmGDa4= Received: by 10.78.124.2 with SMTP id w2mr103411huc; Tue, 08 Aug 2006 19:27:54 -0700 (PDT) Received: by 10.78.39.5 with HTTP; Tue, 8 Aug 2006 19:27:54 -0700 (PDT) Message-ID: Date: Wed, 9 Aug 2006 10:27:54 +0800 From: Li To: "Tomcat Users List" Subject: Re: getRealPath and war file In-Reply-To: <44D943DE.8010206@chem.usyd.edu.au> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <44D943DE.8010206@chem.usyd.edu.au> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, Most of j2ee application servers (tomcat, jboss) when a war or ear file is deployed. It will generate a folder which contains the same file structure (web application format) as which is in the war or ear file. A war is considered as a file but not a path. So if Tomcat only reads war but not a directory based content, it has problem (when changes to parent path, or changes to child path). Besides, a war is a packed jar file, reading a directory based content is a lot more easier and faster than a packed jar file. On 8/9/06, Romain Quilici wrote: > Hi all, > I know that this question has been asked many times, but still something > not clear for me. > When an application is deployed as a war file, (as mentioned in the > javadoc, or in several messages), context.getRealPath() will return null. > However, Tomcat creates automatically a directory under webapps to > contain war file contents, so I am wondering if Tomcat is using the > newly generated directory to load the application(1st case) or > the war file (2nd case). > In the first case context.getRealPath("/") should return the path to the > newly generated directory. > In the second case, why does Tomcat generate the directory to contain > war file contents? > Thanks for the explanation > Regards > Romain > > > > --------------------------------------------------------------------- > 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 > > -- When we invent time, we invent death. --------------------------------------------------------------------- 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