title: Spring servlet mapping not working
body: <p>When I try to load <code>http://localhost:8080/people</code> I receive a 404 page not found error.</p>
  
  <p>This is my servlet mapping iwthin web.xml : </p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
          org.springframework.web.servlet.DispatcherServlet
      &lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;classpath:applicationContext.xml&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/people/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>Here is how I understand it works : </p>
  
  <p>A url request to <code>http://localhost:8080/people</code> will be intercepted by the servlet "spring" and will invoke the class <code>org.springframework.web.servlet.DispatcherServlet</code> Is this correct ?</p>
  
  <p>Do I need some additional configuration in order for this class to be loaded correctly ?</p>
  
  <p>Update : </p>
  
  <p>Here is the controller : </p>
  
  <pre><code>@Controller
  public class PersonController {
  
      @Autowired
      private PersonService personService;
  
      @RequestMapping("/")
      public String listPeople(Map&lt;String, Object&gt; map) {
  
          map.put("person", new Person());
          map.put("peopleList", personService.listPeople());
  
          return "people";
      }
  
      @RequestMapping(value = "/add", method = RequestMethod.POST)
      public String addPerson(@ModelAttribute("person") Person person, BindingResult result) {
  
          personService.addPerson(person);
  
          return "redirect:/people/";
      }
  
      @RequestMapping("/delete/{personId}")
      public String deletePerson(@PathVariable("personId") Integer personId) {
  
          personService.removePerson(personId);
  
          return "redirect:/people/";
      }
  }
  </code></pre>