From users-return-240077-apmail-tomcat-users-archive=tomcat.apache.org@tomcat.apache.org Sun Mar 3 16:22:57 2013 Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0CA16EC09 for ; Sun, 3 Mar 2013 16:22:57 +0000 (UTC) Received: (qmail 40699 invoked by uid 500); 3 Mar 2013 16:22:53 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 40507 invoked by uid 500); 3 Mar 2013 16:22:53 -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 40498 invoked by uid 99); 3 Mar 2013 16:22:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Mar 2013 16:22:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of james.mk.green@gmail.com designates 209.85.216.170 as permitted sender) Received: from [209.85.216.170] (HELO mail-qc0-f170.google.com) (209.85.216.170) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Mar 2013 16:22:49 +0000 Received: by mail-qc0-f170.google.com with SMTP id d42so630014qca.15 for ; Sun, 03 Mar 2013 08:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=PmECIra00z+Pvi0m3TzS4GHz3chFlb3b5MMYrs9Qlis=; b=VbAvEd5rRpbO7yS+lcJYQguWaI8ISSazh+Ydesezab87dAWLMt3Ayr6uPL/diP6jHm foni1YmQTTOPwHiVjxGFYgLXsIUVV1lot3YZCHUrkBOFPhxZ8eZqKDBEr0jAsY8LJSyF N8sZ2+R91tblJtTA0WafRJUHUIdTGl07EDUmXqOFVYn/31qFhTlOFPKsiakzcrWcpDc8 TktxkpPGC56HXxIP6OiLnufjjSTFZSAKhGCJCQKGvfH1IGYYeYAyRI9BFxLA0HFLkBzA GgCDukRL17BnPdtcAQHAtQg1lkpikaJe+oOK+GPqZpy6fBtdgbfNGj46fLfPsh2emuf6 MSUA== MIME-Version: 1.0 X-Received: by 10.49.95.138 with SMTP id dk10mr29963261qeb.43.1362327748493; Sun, 03 Mar 2013 08:22:28 -0800 (PST) Received: by 10.49.35.204 with HTTP; Sun, 3 Mar 2013 08:22:28 -0800 (PST) In-Reply-To: <51337187.1020906@apache.org> References: <51335EFB.4090003@apache.org> <51337187.1020906@apache.org> Date: Sun, 3 Mar 2013 16:22:28 +0000 Message-ID: Subject: Re: Context.xml ignored. From: James Green To: Tomcat Users List Content-Type: multipart/alternative; boundary=047d7b67743c84466d04d707a5f7 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b67743c84466d04d707a5f7 Content-Type: text/plain; charset=ISO-8859-1 On 3 March 2013 15:51, Mark Thomas wrote: > On 03/03/2013 15:29, James Green wrote: > > On 3 March 2013 14:32, Mark Thomas wrote: > > > >> On 03/03/2013 14:24, James Green wrote: > >>> On 3 March 2013 11:34, Konstantin Kolinko > >> wrote: > >>> > >>>> 2013/3/3 James Green : > >> > >>> So now I have a war deployed. Easy enough. Now to set the URL path. > >> There a > >>> lot of talk about Context Descriptors on that page, and at the top one > >>> seems to be read from webapps/[my-war-file]/META-INF/context.xml. > >> Perfect, > >>> but what goes in it? > >>> > >>> Elsewhere, I find Config, and in there we find Context. Aha! Parallel > >>> Deployment? Nope don't want that. Naming? I read that several times, > and > >> I > >>> have no idea still what is trying to be expressed. Does it even apply > to > >>> me? Not sure, let's move on > >> > >> Stop here. The naming section is exactly the bit you need to understand. > >> > >> I'm sure there is scope to improve the docs so if you explain where you > >> start to get lost we can look at improving the wording / adding > >> additional explanation as required. > >> > >> > > > > Diving straight into the Naming section then we describe a relationship > > involving these elements: > > > > - Context Name > > - Context Version > > - Context Path > > - Base file name > > > > Is the base file name the name of the war file built? > > Are the context elements name, version and path, supposed to come from > the > > context.xml file? Other than path, they are not listed in the attributes > > further down the page. > > OK. Lets address the above. Once you are happy you understand what is > going on, I'll suggest an update to the docs that you can review. > > Context path is as defined in the Servlet specification. > > Context name is the unique identifier for a context within a host. If no > version is specified (none is needed unless parallel deployment is being > used) then context name is identical the the context path. If a version > is specified then ##ContextVersion is appended to the context path to > create the context name. > > Context version is a version identifier that is used under parallel > deployment when multiple versions of the same application are deployed > with the same context path. > > Base file name is the common part of the file named used for the WAR > (baseFileName.war) directory (baseFileName) or context.xml file > (baseFileName.xml) from which the application is deployed. > > Context name is derived from base file name by: > - replacing any single '#' characters with '/' > - if the base file name starts with "ROOT", replacing "ROOT" with the > empty string > - if the base file name does not start with "ROOT", pre-pending a > leading '/' > > The base file name controls the context path. If you want to change the > context path, the simplest solution is to change the base file name. Fine. But this is not as described on this page: http://tomcat.apache.org/tomcat-7.0-doc/deployer-howto.html Here, again, i'm told that META-INF/context.xml provides the context descriptor. It also states that dropping the war into webapps/ will consume the web application. Again, in the FAQ, there holds a reference to this file for deployment purposes. I seem not to be alone in thinking this is the case. A simple Google revealed: http://stackoverflow.com/questions/2593472/define-servlet-context-in-war-file If you are suggesting that META-INF/context.xml is not used for the purposes of defining the context path, then quite a few references need to be removed. If you are not suggesting this, then I am still missing the reason why my context.xml does not deploy the application to the path I supply. Thanks for providing your time on this matter so far. James --047d7b67743c84466d04d707a5f7--