tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Green <james.mk.gr...@gmail.com>
Subject Re: Context.xml ignored.
Date Sun, 03 Mar 2013 16:22:28 GMT
On 3 March 2013 15:51, Mark Thomas <markt@apache.org> wrote:

> On 03/03/2013 15:29, James Green wrote:
> > On 3 March 2013 14:32, Mark Thomas <markt@apache.org> wrote:
> >
> >> On 03/03/2013 14:24, James Green wrote:
> >>> On 3 March 2013 11:34, Konstantin Kolinko <knst.kolinko@gmail.com>
> >> wrote:
> >>>
> >>>> 2013/3/3 James Green <james.mk.green@gmail.com>:
> >>
> >>> 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.
> >>  <users-help@tomcat.apache.org>
> >>
> >
> > 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message