You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by D C <dc...@gmail.com> on 2013/08/29 20:02:36 UTC

context path ignored in conf/Catalina/localhost/*

Tomcat 7.0.40
RHEL 6

I am trying to define all of my contexts in conf/Catalina/localhost/*.xml.

This seems to work fine, however I'm having an issue setting the path.

myApp.xml
  <Context path="/tracking" >

This simply does not work.  It worked fine if I put it into
conf/context.xml.

The only way this works is if i rename my war file to tracking.war.


Why is the path ignored?








Thanks,
Dan

RE: context path ignored in conf/Catalina/localhost/*

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: D C [mailto:dc12078@gmail.com] 
> Subject: context path ignored in conf/Catalina/localhost/*

> Tomcat 7.0.40

> I am trying to define all of my contexts in conf/Catalina/localhost/*.xml.
> This seems to work fine, however I'm having an issue setting the path.
> myApp.xml
>   <Context path="/tracking" >
> This simply does not work.

Nor should it.

> The only way this works is if i rename my war file to tracking.war.

Which is exactly what you should do.

> Why is the path ignored?

It's been illegal to put the path attribute in a <Context> element since at least 5.5.  Read the doc:

http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

 - 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


Re: context path ignored in conf/Catalina/localhost/*

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dan,

On 8/29/13 3:47 PM, D C wrote:
> ​Thank you both.  I see in the link you sent me, that "path" can
> only be see from within server.xml. To correct myself from eariler
> i said it worked in context.xml,  when it was in deed server.xml
> where i had it specified.
> 
> 
> I would prefer not to to have to rename the war, but at this point
> im not going to complain about it. :)
> 
> I just spent a lot of time migrating from server.xml to 
> conf/Catalina/localhost/*.xml.   I'll have to deal with a rename to
> make things work properly.

If you don't want to re-name the WAR file (I really don't know why so
many people resist this), you can put the WAR file outside of your
Host's appBase and then use conf/Catalina/localhost/[appname].xml with
a docBase pointing to the WAR on the disk. In this case, the name of
the XML file identifies the context path and you can call the WAR file
anything you want.

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

iQIcBAEBCAAGBQJSJlhSAAoJEBzwKT+lPKRYzwgP/1S5RgXP8cBbx7O5ZLCg19nP
F7JYB+dz6Hy/JKiqFjiYyqOEemfrAjmtOOpy6RprKW9lwu6xdhOsx1cKT9KbaWUv
mJAN0J66ppX5B/AGdQmDgf996dLqtNVVm1YPSu/phr7ykkweJLybPpJSkMC7AnbC
yeNBTEwXuW0gf9J+6J6xm9a1PFQiqXv1THn6PD85nKWpRAD1+OPJikfDuM8cH+zI
U6uP9Vesv2WdAdNGvJ+PJ016XRDL2qPXPQSV+a/wU3CEzke2Q4ebC86ibJufiK8O
osbutL9xQX6t+VNqRgXkjz5EbYMACr5546VHxnyUATIBQkKtMDtyC/VyfbavId6B
yVzGjIVM+tSsWU4SSLhn1dbZzry3x7kqgfuhBSPcLINK/EFmpZAJVWFYu4pLpe/J
XFu//Ddx6W6gqlzrCf0XNzngZxxV14KpfmIg5EiWR+TZPKThYiW3AoKKWvzP/Av7
fq9Hrs1ZHfL2vCdUck6eOH9V/3rlvP5S+PGcPO2pkDAUFuP5JW75UtYlVeGNc6El
eObLocl3FY0IyU1h4fOAahUInznVYFSYYc+0YNg/09BdpxXlhN8GPvEVEUFTJmDI
VXrlYQdxvToZXru0iqJdGoUMYO6G6Yf6biBCsGXC6P16zC/ZBaWS7rnSqqsu0ui/
qwE3fZ5axEQXTdpXBylO
=LDO9
-----END PGP SIGNATURE-----

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


Re: context path ignored in conf/Catalina/localhost/*

Posted by D C <dc...@gmail.com>.
On Thu, Aug 29, 2013 at 2:10 PM, Daniel Mikusa <dm...@gopivotal.com>wrote:

> On Aug 29, 2013, at 2:02 PM, D C <dc...@gmail.com> wrote:
>
> > Tomcat 7.0.40
> > RHEL 6
> >
> > I am trying to define all of my contexts in
> conf/Catalina/localhost/*.xml.
> >
> > This seems to work fine, however I'm having an issue setting the path.
> >
> > myApp.xml
> >  <Context path="/tracking" >
> >
> > This simply does not work.
>
> You generally don't want to set "path".  In most cases, path is inferred
> by the name of your deployment file, either <path>.war or <path>.xml.
>
> > It worked fine if I put it into conf/context.xml.
>
> Yikes.  I wouldn't suggest that.
>
> >
> > The only way this works is if i rename my war file to tracking.war.
>
> That's what you want to do.
>
> > Why is the path ignored?
>
> In this case, it's by design.  See the docs for more info.  Check out the
> "path" attribute, the "Naming" and "Defining a context" sections.
>
>   https://tomcat.apache.org/tomcat-7.0-doc/config/context.html
>
> Dan
>
> >
> >
> >
> >
> >
> >
> >
> >
> > Thanks,
> > Dan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
​Thank you both.  I see in the link you sent me, that "path" can only be
see from within server.xml.
To correct myself from eariler i said it worked in context.xml,  when it
was in deed server.xml where i had it specified.


I would prefer not to to have to rename the war, but at this point im not
going to complain about it. :)

I just spent a lot of time migrating from server.xml to
conf/Catalina/localhost/*.xml.   I'll have to deal with a rename to make
things work properly.




​


Thanks,
Dan

Re: context path ignored in conf/Catalina/localhost/*

Posted by Daniel Mikusa <dm...@gopivotal.com>.
On Aug 29, 2013, at 2:02 PM, D C <dc...@gmail.com> wrote:

> Tomcat 7.0.40
> RHEL 6
> 
> I am trying to define all of my contexts in conf/Catalina/localhost/*.xml.
> 
> This seems to work fine, however I'm having an issue setting the path.
> 
> myApp.xml
>  <Context path="/tracking" >
> 
> This simply does not work.  

You generally don't want to set "path".  In most cases, path is inferred by the name of your deployment file, either <path>.war or <path>.xml.

> It worked fine if I put it into conf/context.xml.

Yikes.  I wouldn't suggest that.

> 
> The only way this works is if i rename my war file to tracking.war.

That's what you want to do.

> Why is the path ignored?

In this case, it's by design.  See the docs for more info.  Check out the "path" attribute, the "Naming" and "Defining a context" sections.

  https://tomcat.apache.org/tomcat-7.0-doc/config/context.html

Dan

> 
> 
> 
> 
> 
> 
> 
> 
> Thanks,
> Dan


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