title: HTTP Status 404 - Servlet mvc-dispatcher is not available jars already added in user library being used
body: <p>Getting an error even after adding all jars in user library HTTP Status 404 - Servlet mvc-dispatcher is not available jars already added in user library being used. Tried all sorts not able to resolve Can't post screenshots as i don't have 10 points </p>
  
  <p>Servlet mapping code in web.xml is below:    </p>
  
  <pre><code>    &lt;servlet&gt;
       &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
       &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet.class&lt;/servlet-class&gt;
       &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
       &lt;/servlet&gt;
  
       &lt;servlet-mapping&gt;
       &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
       &lt;url-pattern&gt;*.spring&lt;/url-pattern&gt;
       &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>My Jsp is below</p>
  
  <pre><code>    &lt;html&gt;
      &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
      &lt;title&gt;Insert title here&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;form action="Login.spring" method = "post"&gt;
      &lt;input type = "text" name = "userName" id = "userName"&gt;
      &lt;input type = "password" name = "password" id = "password"&gt;
      &lt;input type = "submit"&gt;
      &lt;/form&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>My Controller is below<br>
          package com.lnt.controller;</p>
  
  <pre><code>    import java.util.ArrayList;
      import java.util.List;
  
      import javax.servlet.http.HttpServletRequest;
      import javax.servlet.http.HttpServletResponse;
  
      import org.springframework.beans.factory.annotation.Autowired;
      import org.springframework.stereotype.Controller;
      import org.springframework.web.bind.annotation.RequestMapping;
      import org.springframework.web.bind.annotation.RequestMethod;
      import org.springframework.web.bind.annotation.RequestParam;
      import org.springframework.web.servlet.ModelAndView;
  
      import com.lnt.services.AuthenticateServices;
  
      @Controller 
      @RequestMapping("/Login.spring")
      public class LoginController {
  
          //@Autowired
           AuthenticateServices authenticateService = new AuthenticateServices();
  
          @RequestMapping(method=RequestMethod.POST)
          public ModelAndView processCredentials(HttpServletRequest req, HttpServletResponse res)
  
          {
              String userName =req.getParameter("userName") ;
              String password = req.getParameter("password");
              System.out.println("into login controller");
              String message = "Invalid credentials";
              List&lt;String&gt; userdetails = new ArrayList&lt;String&gt;();
              userdetails = authenticateService.verifyUserNameAndPassword(userName, password);
              if((userdetails)!=null)
                  {
                  message = "welcome" + userName ;
              }
              return new ModelAndView("results", "message", message) ;
          }
  
  
  
          }
  </code></pre>
  
  <p>Here is the stack trace :</p>
  
  <p>java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet.class
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1095)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)</p>