You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andy Chapman <an...@brighterworking.com> on 2011/09/20 10:53:19 UTC

Who gets which request?

I have a Tomcat 7.0.16 install with two WAR based webapps in it.

First test case:
Two war files in <tomcat-home>/webapps at startup
1. ROOT.war
2. another.war
If I request http://localhost:8080/another/something it goes to the 
another webapp.

Second test case:
Two war files in <tomcat-home>/webapps at startup
1. ROOT.war
2. wibble.war
If I request http://localhost:8080/wibble/something it goes to the ROOT 
webapp.

Third test case:
One war file in <tomcat-home>/webapps at startup
1. ROOT.war
Second war file added to <tomcat-home>/webapps after startup (with 
auto-deploy on)
2. another.war
If I request http://localhost:8080/another/something it goes to the ROOT 
webapp.

It looks like Tomcat is adding the webapps contexts to it's "filter" 
list in alphabetical order at startup and then adding any auto-deployed 
WARs afterwards but I can't believe it is that simple. Can anyone 
give/link to a proper explanation?

Cheers





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


Re: Who gets which request?

Posted by Mark Thomas <ma...@apache.org>.
On 20/09/2011 09:53, Andy Chapman wrote:
> I have a Tomcat 7.0.16 install with two WAR based webapps in it.
> 
> First test case:
> Two war files in <tomcat-home>/webapps at startup
> 1. ROOT.war
> 2. another.war
> If I request http://localhost:8080/another/something it goes to the
> another webapp.
> 
> Second test case:
> Two war files in <tomcat-home>/webapps at startup
> 1. ROOT.war
> 2. wibble.war
> If I request http://localhost:8080/wibble/something it goes to the ROOT
> webapp.

That isn't right. Looks like wibble.war failed to deploy.

> Third test case:
> One war file in <tomcat-home>/webapps at startup
> 1. ROOT.war
> Second war file added to <tomcat-home>/webapps after startup (with
> auto-deploy on)
> 2. another.war
> If I request http://localhost:8080/another/something it goes to the ROOT
> webapp.

That isn't right. Looks like another.war failed to deploy.

> It looks like Tomcat is adding the webapps contexts to it's "filter"
> list in alphabetical order at startup and then adding any auto-deployed
> WARs afterwards but I can't believe it is that simple. Can anyone
> give/link to a proper explanation?

Requests are mapped to contexts based on the longest matching context
path (as per the Servlets spec).

You can use the Manager app to see if apps have deployed and are started.

Mark

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


Re: Who gets which request?

Posted by André Warnier <aw...@ice-sa.com>.
Andy Chapman wrote:
> I have a Tomcat 7.0.16 install with two WAR based webapps in it.
> 
> First test case:
> Two war files in <tomcat-home>/webapps at startup
> 1. ROOT.war
> 2. another.war
> If I request http://localhost:8080/another/something it goes to the 
> another webapp.

That is the expected behaviour.

> 
> Second test case:
> Two war files in <tomcat-home>/webapps at startup
> 1. ROOT.war
> 2. wibble.war
> If I request http://localhost:8080/wibble/something it goes to the ROOT 
> webapp.

That does not look normal.
But, how do you *really* know that it /goes to/ the ROOT webapp ?
Can you provide some details ?

> 
> Third test case:
> One war file in <tomcat-home>/webapps at startup
> 1. ROOT.war
> Second war file added to <tomcat-home>/webapps after startup (with 
> auto-deploy on)
> 2. another.war
> If I request http://localhost:8080/another/something it goes to the ROOT 
> webapp.
>
That does not look normal either.
But, how do you *really* know that it /goes to/ the ROOT webapp ?
Can you provide some details ?

> It looks like Tomcat is adding the webapps contexts to it's "filter" 
> list in alphabetical order at startup and then adding any auto-deployed 
> WARs afterwards but I can't believe it is that simple. Can anyone 
> give/link to a proper explanation?

read this carefully :
http://tomcat.apache.org/tomcat-7.0-doc/deployer-howto.html



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