Servlet to be accessible from a browser, then must tell the servlet container what servlets to deploy, and what URL's to map the servlets to. This is done in the web.xml file of your Java web application.
use web.xml in servlet
<servlet>
<description></description>
<display-name>servlet class name</display-name>
<servlet-name>servlet class name</servlet-name>
<servlet-class>servlet package name/servlet class name</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>servlet class name</servlet-name>
<url-pattern>/servlet class name</url-pattern>
</servlet-mapping>
manly use web.xml for servlet mapping.