title: org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/controller/] in DispatcherServlet with name 'SpringMVC'
body: <p>i am new to Spring technology. I created a Spring MVC project when i try to run project using Tomcat i am getting following error in eclipse console. Please help me out, i tried several options by searching in Google but clueless. I don't know where went wrong...</p>
  
  <h2>Error:</h2>
  
  <pre><code>org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/controller/] in DispatcherServlet with name 'SpringMVC'
  </code></pre>
  
  <h2>HomeController.java</h2>
  
  <pre><code>@Controller
    public class HomeController {
  
  @RequestMapping(value = "/student", method = RequestMethod.GET)
     public ModelAndView student() {
        return new ModelAndView("student", "command", new Student());
     }
  
     @RequestMapping(value = "/addStudent", method = RequestMethod.POST)
     public String addStudent(@ModelAttribute("SpringWeb")Student student, 
     ModelMap model) {
        model.addAttribute("name", student.getName());
        model.addAttribute("age", student.getAge());
        model.addAttribute("id", student.getId());
  
        return "result";
     }
  
    }
  </code></pre>
  
  <h2>web.xml</h2>
  
  <pre><code> &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/root-context.xml&lt;/param-value&gt;
   &lt;/context-param&gt;
  
   &lt;listener&gt;
       &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
   &lt;/listener&gt;
  
   &lt;servlet&gt;
      &lt;servlet-name&gt;SpringMVC&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;/WEB-INF/SpringMVC-servlet.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;SpringMVC&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>
  
  <h2>SpringMVC-servlet.xml</h2>
  
  <pre><code>  &lt;mvc:annotation-driven /&gt;
    &lt;context:component-scan base-package="com.spring.controller" /&gt;
    &lt;resources mapping="/resources/**" location="/resources/" /&gt;
    &lt;beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;beans:property name="prefix" value="/WEB-INF/views/" /&gt;
      &lt;beans:property name="suffix" value=".jsp" /&gt;
    &lt;/beans:bean&gt;
  </code></pre>