title: How to configure welcome file list in web.xml
body: <p>I have this in my web.xml document. I am trying to have a welcome list so I dont need to type the path for the home page anymore. But everytime a clicked the application in my tomcat page it displays The requested resource is not available.</p>
  
  <pre><code>&lt;listener&gt;
      &lt;listener-class&gt;web.Init&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;index&lt;/servlet-name&gt;
      &lt;servlet-class&gt;web.IndexServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;index&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/index&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>My servlet for the jsp page </p>
  
  <pre><code>package web;
  
  import java.io.IOException;
  
  import javax.servlet.RequestDispatcher;
  import javax.servlet.ServletConfig;
  import javax.servlet.ServletContext;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import org.apache.log4j.Logger;
  
  public class IndexServlet extends HttpServlet
  {
      private Logger logger = Logger.getLogger(this.getClass());
      private RequestDispatcher jsp;
  
      public void init(ServletConfig config) throws ServletException
      {
          ServletContext context = config.getServletContext();
          jsp = context.getRequestDispatcher("/WEB-INF/jsp/index.jsp");
      }
  
      protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
      {
          logger.debug("doGet()");
          jsp.forward(req, resp); 
      }
  }
  </code></pre>
  
  <p>Why is that it is still not working?I still need to type the /index in my url...How to do this correctly?</p>