title: showing 404 error while deploying my Servlets progra
body: <p>My Servlets program</p>
  
  <pre><code>package com.srccode.example;
  import java.io.IOException;
  import java.io.PrintWriter;
  import javax.servlet.Servlet;
  import javax.servlet.ServletConfig;
  import javax.servlet.ServletException;
  import javax.servlet.ServletRequest;
  import javax.servlet.ServletResponse;
  
  
  public class  Jaan implements Servlet{  
  ServletConfig config=null;  
  
  public void init(ServletConfig config){  
  this.config=config;  
  System.out.println("servlet is initialized");  
  }  
  
  public void service(ServletRequest req,ServletResponse res)  
  throws IOException,ServletException{  
  
  res.setContentType("text/html");  
  
  PrintWriter out=res.getWriter();  
  out.print("&lt;html&gt;&lt;body&gt;");  
  out.print("&lt;b&gt;hello simple servlet&lt;/b&gt;");  
  out.print("&lt;/body&gt;&lt;/html&gt;");  
  
  }  
  public void destroy(){System.out.println("servlet is destroyed");}  
  public ServletConfig getServletConfig(){return config;}  
  public String getServletInfo(){return "copyright 2007-1010";}  
  
  } 
  </code></pre>
  
  <p><strong>Update:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
    &lt;display-name&gt;HelloWorldServlets&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>while deploying this program on Tomcat server it showing 404 error why? Is there is any wrong in my code.404 error in browser screenshot is -->  <a href="http://i.stack.imgur.com/CuPuy.png" rel="nofollow">http://i.stack.imgur.com/CuPuy.png</a>. Resolve this problem</p>