1. Servlets consist of a java class typically derived from HttpServletClass and they implement the doPost and doGet methods of this class.
2. Create the class file for your java servlet class, for example a class called com.mine.test.HelloWorld - the file is located in the directory com/mine/test/HelloWorld.class
3. In webapps directory in the tomcat folder, create a new directory e.g. "helloservlet". This is the application root directory for the servlet.
4. In this directory create the following directory
WEB-INF
WEB-INF \ classes
5. Copy the entire class file directory structure under WEB-INF \ classes. The result is:
WEB-INF \ classes \ com \ mine \ test \ HelloWorld.class
5. Create the file web.xml in the WEB-INF directory. It should contain the following:
<
7. Launch a web browser and navigate to the following url:
http://localhost:8080/helloservlet/hws