tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Configure read/write-access in TomCat
Date Wed, 18 Aug 2010 13:39:50 GMT
K A wrote:
> Ah, so the web.xaml in /tomcat/conf has nothing to do with the issue - it's only the
web.xml in the project itself?

The conf/web.xml is the web.xml for the "default servlet".
The webapps/your-webapp/WEB-INF/web.xml is the one that dictates what happens when users
access /your-webapp/*.

When Tomcat processes a request, it will first look at the URL and determine to which
"webapp" (or context) it should pass the request.

Say the URL is "/your-webapp/some-document.txt".

Tomcat will look at the file webapps/your-webapp/WEB-INF/web.xml, to see if there is any
mapping there that assigns "/some-document.txt" to some servlet or JSP page inside
your-webapp.  If it finds one, then it will invoke that servlet/JSP, and pass the request
to it.

If Tomcat does not find any mapping inside that application's web.xml file that is
applicable to "/some-document.txt", then it will look into the conf/web.xml file to find
an appropriate mapping.  If it finds one (which it always does) then it will invoke its
default servlet to handle this call.
The default servlet is essentially one that will look onto the filesystem for a file named
"(tomcat-dir)/webapps/your-webapp/some-document.txt", and return a copy "as is" to the

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message