-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Sebastien,

On 3/31/14, 12:43 PM, Sebastien Tardif wrote:
> I understand that Tomcat currently doesn't always support
> specifying the context root to be used in a file inside the War.

You are correct in that you cannot have a completely self-contained
WAR file that specifies a context root that is not the same name as
the WAR file itself (excepting ROOT, which is special, of course).

But as Mark says, you can use an external configuration file to do
this for you.

What is your use case that you can't name the WAR file whatever you
want, or that you *must* deploy the WAR file under one name and have
the context path be different *and* you can't use an external
configuration file?

> Extract from: 
> http://tomcat.apache.org/tomcat-7.0-doc/config/context.html When 
> autoDeploy or deployOnStartup operations are performed by a Host,
> the name and context path of the web application are derived from
> the name(s) of the file(s) that define(s) the web application. 
> Consequently, the context path may not be defined in a 
> META-INF/context.xml embedded in the application and there is a
> close relationship between the context name, context path, context
> version and the base file name (the name minus any .war or .xml
> extension) of the file.
> 
> Other web server handle this better, like GlassFish and it's very 
> convenient. Usability is something we should try to achieve.
> 
> Since, in all cases, the War will need to be "read" anyway, how
> hard or costly that can be to lookup a configuration file and read
> it?
> 
> I think we cannot mentions "performance" reasons for current
> behavior since everything else that need to be done will always be
> x factor way slower. It's like optimizing string concatenation
> become calling a database, that makes me laugh in each project I
> work on.

I have no idea what you are talking about, here. Tomcat does not read
the context root from within the WAR file, and it's not for
performance reasons.

> That issue is the only one that makes the infamous GlassFish looks 
> better so I wanted to raise it.

If Glassfish better meets your needs, then you should use it.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTObniAAoJEBzwKT+lPKRYJ28P/3uwHKyf7MHEVLXoT6KtwP6D
RNwl1GSxsE8rL72GDMBc2F8fkghEIQLNirSpIQ3BqKl7831kYgJZdoF+/PNOA5hN
FWRCQyjZOxliTd77M2bS4VONef63RplpVZL+J58qSAOq5uwb30+ILjpLIx4qf/wC
jT6XTghE1TsAOzeZCAhkgLZL5KPSKLBxQ0kElLZljVD2xSBYVcH89B4ioA2odTX5
5cBNwGLFbew5WL4mST8v/ZUNzm466CCD+i9mqlDLMwR2Ya73g6mZTTLem8WjNIYX
9M9c4qxlTPjfNW2S2f33QI8UAiuIdxkxHUj7zl7I+rY45GJZRIHT7xyZXAjoTEJ7
JvBkB7BZf2op2bdLTZ9UC6Z5GzOO91ktM7mP3+ucn389ik4pmQxIgSo+yaok3iJ4
vloc6si9FE40Ac9d/h/Xpuz2EiC5LuwM7T1BfcvtNPwWiSuFw7CkSfHbS+Y1MS1+
t6PBPskKbL2EP/9XRrlt9LFy4DldvFEK9KFn02pqufJ8YA8cR4ob4+kK92vqpze0
C7JtzmPx6xzMKae9J+dM7HZbUViqa6swxThKDlD4hezjv2BgaFO+Qbd+2Is0fYNs
vvYoJj7mpOZIlWhxO88bCHV8QSAX47B9QlAW2PwYKPIjEBFZ7txXJIETPFdRSKOc
QU3jPFXqiFsZJzDTm4uD
=TwK9
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to