Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 83293 invoked from network); 23 Jan 2006 11:36:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jan 2006 11:36:01 -0000 Received: (qmail 8208 invoked by uid 500); 23 Jan 2006 11:35:44 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 8193 invoked by uid 500); 23 Jan 2006 11:35:44 -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 8182 invoked by uid 99); 23 Jan 2006 11:35:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2006 03:35:44 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [217.140.77.184] (HELO mail.schoenhaber.de) (217.140.77.184) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2006 03:35:43 -0800 Received: from localhost (unknown [127.0.0.1]) by mail.schoenhaber.de (Postfix) with ESMTP id 52F5C700EF2F for ; Mon, 23 Jan 2006 11:35:22 +0000 (UTC) Received: from mail.schoenhaber.de ([127.0.0.1]) by localhost (mail.schoenhaber.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12668-06 for ; Mon, 23 Jan 2006 12:35:21 +0100 (CET) Received: from Gimli.schoenhaber.de (Gimli [192.168.42.6]) by mail.schoenhaber.de (Postfix) with ESMTP id 9226A700EF2E for ; Mon, 23 Jan 2006 12:35:21 +0100 (CET) From: Markus =?iso-8859-15?q?Sch=F6nhaber?= Reply-To: tomcat-user@jakarta.apache.org To: "Tomcat Users List" Subject: Re: Overlapping contexts? Date: Mon, 23 Jan 2006 12:35:21 +0100 User-Agent: KMail/1.9 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200601231235.21250.mailing-tomcat-user@schoenhaber.de> X-Virus-Scanned: amavisd-new at schoenhaber.de X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Chris Mooring wrote: > I was just wondering if it is possible to have "overlapping contexts"? I am > not sure if this will make sense so I'll try and explain it with a little > example; > > Basically, I'd like to be able to have two *similar* URL's map to separate > locations on the filesystem; > > Example; > localhost/myapp/index.jsp (refers to C:\myapp\index.jsp) > localhost/myapp/external/index.jsp (refers to Z:\otherapp\index.jsp) > > Ideally, I'd like to achieve this using Tomcat's > > ... > > ... > > > element in server.xml. The important part here is that both contexts begin > with /myapp! > > However, the last time I tried this, I had several different errors when > Tomcat started up. I believe this may be due to the fact that with Tomcat > 5.5 and above you shouldn't have context tags in server.xml. Therefore, I > tried similar things in conf/context.xml with much similar results > (errors). I then tried separate context files in > C:\tomcat5\work\Catalina\localhost but this didn't work either. If you store your information in individual files in .../conf/Catalina/localhost ("conf", not "work"), the path-Attribute is ignored and the path information is derived from the name of the XML-file. So if you want to define a which shall be accessible via http://your.server/myapp the XML-file has to be named "myapp.xml". http://tomcat.apache.org/tomcat-5.5-doc/config/context.html If the 's path shall contain slashes, replace them with "#" in the file name. I don't know if this works but what you could try is the following: put the two s you mention above each in an individual XML-file under .../conf/Catalina/localhost and name the first "myapp.xml" and the second "myapp#external.xml". Regards mks --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org