You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by James Hoare <Ja...@net-a-porter.com> on 2009/02/04 11:05:39 UTC

Setting a Different context path to webapp name

Hi, was hoping someone would help with the following. I have a webapp called myApp.war but I would like to set this to a different url path than the webapp name. I've seen in the docs that you can specify an xml file under Catalina_Home/Catalina/localhost/newurlname.xml.


I have tried this but I get an error stating that the docBase doesn't exist?


in my xml file I just have a <Context></Context> definition I don't specify a docBase?

Can anyone clarify the correct procedure?

Thanks


Discover spring's new designers at http://www.net-a-porter.com/Content/NewDesignersforSS09form
______________________________________________________________________

CONFIDENTIALITY NOTICE
The information in this email is confidential and is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you must not read, use or disseminate the information. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Net a Porter Ltd. 

Net A Porter Ltd is a company registered in England & Wales Number: 3820604 Registered Office: The Dome, Whiteleys Centre, 151 Queensway, London, W2 4YN.
_____________________________________________________________________

Re: Setting a Different context path to webapp name

Posted by Kees de Kooter <kd...@gmail.com>.
In the context tag you need to add an attribute named docBase pointing
to your warfile.

Cheers,
Kees de Kooter
http://www.boplicity.net



On Wed, Feb 4, 2009 at 11:05, James Hoare <Ja...@net-a-porter.com> wrote:
>
> Hi, was hoping someone would help with the following. I have a webapp called myApp.war but I would like to set this to a different url path than the webapp name. I've seen in the docs that you can specify an xml file under Catalina_Home/Catalina/localhost/newurlname.xml.
>
>
> I have tried this but I get an error stating that the docBase doesn't exist?
>
>
> in my xml file I just have a <Context></Context> definition I don't specify a docBase?
>
> Can anyone clarify the correct procedure?
>
> Thanks
>
>
> Discover spring's new designers at http://www.net-a-porter.com/Content/NewDesignersforSS09form
> ______________________________________________________________________
>
> CONFIDENTIALITY NOTICE
> The information in this email is confidential and is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you must not read, use or disseminate the information. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Net a Porter Ltd.
>
> Net A Porter Ltd is a company registered in England & Wales Number: 3820604 Registered Office: The Dome, Whiteleys Centre, 151 Queensway, London, W2 4YN.
> _____________________________________________________________________
>

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


RE: Setting a Different context path to webapp name

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: James Hoare [mailto:James.Hoare@net-a-porter.com]
> Subject: Setting a Different context path to webapp name
>
> I have a webapp called myApp.war but I would like to
> set this to a different url path than the webapp name.

The easiest thing to do is just rename the .war file, but if you insist on doing things the hard way:

1) Do not put the .war file in the <Host> appBase directory - keep it somewhere else.

2) Create a file named newurlname.xml in conf/Catalina/[host] containing a <Context> element.

3) Set the docBase attribute of the above <Context> element to point to the *absolute* path to the .war file.

> I've seen in the docs that you can specify an xml file under
> Catalina_Home/Catalina/localhost/newurlname.xml.

What docs were those?  They left out a critical component of the path (at least for a real Tomcat installation).

> in my xml file I just have a <Context></Context> definition

An empty <Context> element is never needed.

 - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org