The most common deployment for a web app is using a war. However, if
you wnat to do it manually, you can create a directory tree under the
<tomcat_root>/webapps directory. Under this directory, you need
another directory called WEB-INF(all caps). This is where web.xml is
stored. deploy your classes under WEB-INF/classes and libraries into
WEB-INF/lib.
The web.xml is not too tricky. It is a basic xml file with the normal
xml prolog and a DOCTYPE that indicates it is a webapp and a uri to
the dtd. Here is a sample:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>CactusTestRoot</display-name>
<servlet>
<servlet-name>sampleservlet</servlet-name>
<servlet-class>SampleServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>sampleservlet</servlet-name>
<url-pattern>/SampleServlet</url-pattern>
</servlet-mapping>
</web-app>
The servlet tag defines the servlet class with an alias. The mapping
is the url that specifies the url that will use that servlet. In this
case, it is /SampleServlet. There are quite a few more tags, but this
is a basic web.xml.
A war is all of the above with a manifest in a zip/jar renamed with
the .war extension. tomcat can auto-deploy wars. Remember, your
web.xml and related classes go under the WEB-INF directory under the
webapp root.