The deployment descriptor (
web.xml file in
Tomcat) initializes and maps your Servlets to specific URL
patterns. When a request comes in that matches one of the URL patterns you define in the deployment descriptor, the server calls the appropriate Servlet mapped to that URL pattern.
You might see something like this in an HTML form:
The URL pattern is
servlet/ProcessFormServlet. Now, in your deployment descriptor,
you should define a servlet called ProcessFormServlet. You should map this servlet to the URL pattern servlet/ProcessFormServlet. Realize, there is no actual
servlet directory -- this is simply a URL pattern that you define that maps to your servlet.
The deployment descriptor allows you to define and intialize servlets, configure your web app, and a whole lot of other cool stuff too. You might look at investing in a good book. Specifically, if you're using Tomcat, I'd suggest
Mastering Tomcat Development by Harrison.