hi vivek,
I have a doubt regarding this .
Suppose I have a webapps directory somewhat like this
webapps
|_ ROOT
|_ MyApp
There is servlet mapping in ROOT app where there is a mapping like this /MyApp/servlet/xyz
and in MyApp ap we have a servlet mapping /servlet/xyz .
Servlet from which application is picked up ?
Its very important to know how container picks a servlet from which web app .(means how it identify the correct web app and then correct servlet)
Since the request uri consist of three main parts
Context Path- this helps container to choose the correct web app
ServletPath-this helps container to identify correct servlet into the from the requested web app.
PathInfo-in case of directory match
So if the request uri is
http://server.com/MyApp/servlet/xyz ,the container will first look for a web app named
MyApp if it exists then it will look for the resource(here servlet) mapped to /servlet/xyz.
In case if there is no web app named MyApp then it (
Tomcat)will look into the default web app (ROOT) for the servlet mapped to the uri /MyApp/servlet/xyz and proceed acc to that.
I have also tested this on my Tomcat
Correct me i am wrong..
regards
-santosh
[ May 02, 2006: Message edited by: singh santosh ]