You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Rhoden <ja...@rhoden.id.au> on 2007/01/06 01:09:46 UTC

Deploying to / using context.xml

Hi Guys,

I am a bit stuck with something. When I deploy my web app in netbeans 
5.5 it puts my app under / (instead of /Appname/) after changing the 
context.xml

When I deploy using the tomcat manager manually to the production site, 
it goes under /Appname/, why would this be?

My context.xml file is:
  <?xml version="1.0" encoding="UTF-8"?>
  <Context path="/"/>


I have tried with path="" and path="/", what am i doing wrong? They are 
both tomcat 5.5.x

Thanks!
Jacob

---------------------------------------------------------------------
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: Deploying to / using context.xml

Posted by Martin Gainty <mg...@hotmail.com>.
This is a bit like string theory; if you think you understand it, you
obviously don't :-)

MG>and for the record Neither do you 
MG>you really do need to Stop with this self-righteous pontificating condescending tripe you're sending
MG>It alienates users from this list and make you look like a pretentious fob

MG>Bye!

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: Deploying to / using context.xml

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Jacob Rhoden [mailto:jacob@rhoden.id.au] 
> Subject: Re: Deploying to / using context.xml
> 
> Thanks! That makes it all clear (:

This is a bit like string theory; if you think you understand it, you
obviously don't :-)

> So it means if you have 5 hosts you need to have 
> 5 applications in netbeans all called ROOT (:

I don't use NetBeans, so I can't speak to that, but for Tomcat itself,
no, you only need one.  However, you will need five ROOT.xml files, one
for each conf/Catalina/[host] directory, but all of them can use the
same value for the docBase attribute.  This default app would be
deployed once for each <Host>, which is pretty much required by the
servlet spec.

 - 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: Deploying to / using context.xml

Posted by Jacob Rhoden <ja...@rhoden.id.au>.
Thanks! That makes it all clear (:  So it means if you have 5 hosts you 
need to have 5 applications in netbeans all called ROOT (:

Caldarale, Charles R wrote:
>> From: Jacob Rhoden [mailto:jacob@rhoden.id.au] 
>> Subject: Re: Deploying to / using context.xml
>>
>> Thanks, let me change my question then (: Given a <Host> entry with a 
>> directory /usr/local/tomcat/webapps3, and the 
>> /usr/local/tomcat/conf/Catalina/hostname/manager.xml in 
>> place. How do I 
>> easily deploy/redeploy war files for the root directory?
>>     
>
> If by "root directory" you mean the default app for the <Host>, it must
> be named ROOT (case sensitive).  If you want it under webapps3, the app
> should go in either the webapps3/ROOT subdirectory, or
> webapps3/ROOT.war.  If your app is deployed outside of the appBase, then
> place a ROOT.xml file in conf/Catalina/hostname containing a <Context>
> element with the appropriate docBase attribute, and delete any ROOT
> directory under webapps3.
>
> If you really, really want to call your default app something other than
> ROOT, the simplest solution is to have a dummy app in ROOT that does
> nothing but redirect or forward to the desired default.
>
>  - 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
>
>   
   

---------------------------------------------------------------------
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: Deploying to / using context.xml

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Jacob Rhoden [mailto:jacob@rhoden.id.au] 
> Subject: Re: Deploying to / using context.xml
> 
> Thanks, let me change my question then (: Given a <Host> entry with a 
> directory /usr/local/tomcat/webapps3, and the 
> /usr/local/tomcat/conf/Catalina/hostname/manager.xml in 
> place. How do I 
> easily deploy/redeploy war files for the root directory?

If by "root directory" you mean the default app for the <Host>, it must
be named ROOT (case sensitive).  If you want it under webapps3, the app
should go in either the webapps3/ROOT subdirectory, or
webapps3/ROOT.war.  If your app is deployed outside of the appBase, then
place a ROOT.xml file in conf/Catalina/hostname containing a <Context>
element with the appropriate docBase attribute, and delete any ROOT
directory under webapps3.

If you really, really want to call your default app something other than
ROOT, the simplest solution is to have a dummy app in ROOT that does
nothing but redirect or forward to the desired default.

 - 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: Deploying to / using context.xml

Posted by Jacob Rhoden <ja...@rhoden.id.au>.
Thanks, let me change my question then (: Given a <Host> entry with a 
directory /usr/local/tomcat/webapps3, and the 
/usr/local/tomcat/conf/Catalina/hostname/manager.xml in place. How do I 
easily deploy/redeploy war files for the root directory?

Best Regards,
Jacob

Caldarale, Charles R wrote:
>> From: Jacob Rhoden [mailto:jacob@rhoden.id.au] 
>> Subject: Deploying to / using context.xml
>>
>> I have tried with path="" and path="/", what am i doing 
>> wrong? They are both tomcat 5.5.x
>>     
>
> Unless your <Context> element is in server.xml (strongly discouraged),
> there should not be a path attribute at all.  Tomcat determines the URL
> path to the app based on the directory (or war file) name of the app if
> it's under appBase, or the name of the .xml file if that's placed in
> conf/Catalina/[host].  Look at the doc for the path attribute of
> <Context>:
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>
> "The value of this field must not be set except when statically defining
> a Context in server.xml, as it will be infered [sic] from the filenames
> used for either the .xml context file or the docBase."
>
>  - 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
>
>   


---------------------------------------------------------------------
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: Deploying to / using context.xml

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Jacob Rhoden [mailto:jacob@rhoden.id.au] 
> Subject: Deploying to / using context.xml
> 
> I have tried with path="" and path="/", what am i doing 
> wrong? They are both tomcat 5.5.x

Unless your <Context> element is in server.xml (strongly discouraged),
there should not be a path attribute at all.  Tomcat determines the URL
path to the app based on the directory (or war file) name of the app if
it's under appBase, or the name of the .xml file if that's placed in
conf/Catalina/[host].  Look at the doc for the path attribute of
<Context>:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

"The value of this field must not be set except when statically defining
a Context in server.xml, as it will be infered [sic] from the filenames
used for either the .xml context file or the docBase."

 - 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