web.xml file

tutorial and example
tutorial and example

Creating a servlet class is not enough. We have to deploy that class also. So, to deploy the class we use web.xml file. In this file we have to map our class configurations.

We just required to edit and add some tag in our web.xml file through a text editor. Each tag contains some unique specification.

<servlet-name>: We can provide any specific name that represents a servlet class. The name can be same as of class name.

<servlet-class>: A name of servlet class is given with this tag.

<welcome-file-list>: If we want to attach other files such as html, htm, jsp with our servlet class then we have to deploy that file in this tag. Here each file is mapped separately in <welcome-file> tag.