When the servlet container gets a request URL: http://localhost/myapps/myservlet It first checks if myapps directory is present in webapps. if no matching directory, myservlet is assumed to be in a package called myapps in the default web application. Guys, please correct me if i'm wrong.
Actually I think that Tomcat does a scan of webapps when it first starts up, and checks each directory to see if it has a WEB-INF subdirectory with a web.xml descriptor. So when a request comes in, Tomcat already knows if there is a corresponding web application. During that initial scan Tomcat can locate and expand WAR files also. Bill