You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Aaron Chai <ac...@hotmail.com> on 2007/01/11 03:05:09 UTC

Is it possible to deploy a war file which gives a different context name?

Is it possible for Tomcat to deploy war files where the context name is not 
the same as the original war file name, e.g. deploying webapp.war and the 
context name is /mainApp instead of /webapp. How would this be achieved if 
it is possible?

Thanks.

_________________________________________________________________
Shop ‘til you drop at XtraMSN Shopping http://shopping.xtramsn.co.nz/home/


---------------------------------------------------------------------
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


Re: Is it possible to deploy a war file which gives a different context name?

Posted by Markus Schönhaber <ma...@schoenhaber.de>.
Aaron Chai wrote:
> Is it possible for Tomcat to deploy war files where the context name is not
> the same as the original war file name, e.g. deploying webapp.war and the
> context name is /mainApp instead of /webapp. How would this be achieved if
> it is possible?

I don't think this is possible - at least not with Tomcat >= 5. As
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
states, the only case where the Context's path may be set via a configuration 
option is when statically defining a Context in server.xml - which is 
discouraged and doesn't go along well with deploying a war file.

Regards
  mks

---------------------------------------------------------------------
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


RE: Is it possible to deploy a war file which gives a different contextname?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tim Funk [mailto:funkman@joedog.org] 
> Subject: Re: Is it possible to deploy a war file which gives 
> a different contextname?
> 
> 1) Keep the war file out of the tomcat installation
> 2) Use a context declaration which points to the war file 
> (mainApp.xml)
> 3) Don't unpack wars (<Host ... unpackWARs="false" ...>)
> 
> mainApp.xml
> ===
> <Context docBase='/usr/local/wars/foo.war'/>
> ===

The only thing missing from the above is that the [appName].xml file
containing the <Context> element with the docBase attribute should be
placed in conf/[engine]/[host] (usually conf/Catalina/localhost).  You
definitely don't want to put it in server.xml; doing so requires
restarting Tomcat when any changes are made to the app.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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


Re: Is it possible to deploy a war file which gives a different context name?

Posted by Tim Funk <fu...@joedog.org>.
Yes (I think)
1) Keep the war file out of the tomcat installation
2) Use a context declaration which points to the war file (mainApp.xml)
3) Don't unpack wars (<Host ... unpackWARs="false" ...>)

mainApp.xml
===
<Context docBase='/usr/local/wars/foo.war'/>
===

-Tim

Aaron Chai wrote:
> Is it possible for Tomcat to deploy war files where the context name is 
> not the same as the original war file name, e.g. deploying webapp.war 
> and the context name is /mainApp instead of /webapp. How would this be 
> achieved if it is possible?


---------------------------------------------------------------------
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