How does Tomcat handle overlapping/shadowing names in context paths or URLs?
Asked Answered
A

0

6

How does Tomcat 8.0 serve http requests in the following scenario?

Let's say we have deployed the two web applications "ROOT.war" and "Foo.war" on a server with the name "www.host.com". Furthermore, let's assume that ROOT.war contains a subfolder named "Foo" which contains a file "mypage.html". Additonally, let's assume "Foo.war" also contains a file named "mypage.html". So after extraction of the war-files Tomcat's webapps directory should look like this:

webapps\ROOT\Foo\mypage.html
webapps\Foo\mypage.html

If a user made a request to

http://www.host.com/Foo/mypage.html

in his browser, which file would he be served? The mypage.html from ROOT.war or the one from Foo.war?

Amplification answered 23/4, 2015 at 7:33 Comment(2)
Anybody? I'm looking for some kind of reference where Tomcat's behaviour for such a case is specified.Amplification
Very interesting question which looks trivial if you don't read carefully.Accusatorial

© 2022 - 2024 — McMap. All rights reserved.