tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Tomcat mapping of URLs -> servlets
Date Wed, 03 Dec 2008 15:25:10 GMT
André Warnier wrote:
> Mark Thomas wrote:
>> André Warnier wrote:
>>> Then I guess I have (at least) 2 webapps : a "/foo" webapp, and a
>>> "/foo/bar" webapp.
>>>
>>> Now a request comes in with the url "/foo/bar/baz/various.jsp"
>>>
>>> How does Tomcat determine that /foo/bar/baz is not itself a webapp, but
>>> merely a sub-dir of webapp "/foo/bar" ?
>>
>> The longest context path always wins. So in this case any request to
>> /foo/bar/... will always be handled by the /foo/bar webapp.
>>
> I guess I wasn't clear enough in my question.
> 
> What I meant to ask was : considering the apparent path of the URL is
> "/foo/bar/baz/", how/why does Tomcat "give up" on the "/foo/bar/baz"
> (potential) webapp path, and attribute this to the "/foo/bar" webapp.
> 
> Of course, you and me know that there is no webapp in "/foo/bar/baz",
> but we're smart humans who can just see this at a glance.
> But how Tomcat know ?
> Because there is no WEB-INF there, right now when it checks ? or because
> of something we did/did not tell him earlier ?

It maintains an internal list of deployed contexts (web apps) and their
associated paths so it knows there is no /foo/bar/baz webapp.

Mark



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


Mime
View raw message