title: org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI
body: <p>Hi i am new Spring Mvc.</p>
  
  <p>and i am not unable to solve this problem</p>
  
  <p>Dispatcher servlet (servlet-context.xml)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p>http://www.springframework.org/schema/mvc/spring-mvc.xsd
           <a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a>    <a href="http://www.springframework.org/schema/beans/spring-beans.xsd" rel="nofollow">http://www.springframework.org/schema/beans/spring-beans.xsd</a>
          <a href="http://www.springframework.org/schema/context" rel="nofollow">http://www.springframework.org/schema/context</a> <a href="http://www.springframework.org/schema/context/spring-context.xsd" rel="nofollow">http://www.springframework.org/schema/context/spring-context.xsd</a>"></p>
  
  <pre><code>&lt;!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure --&gt;
  
  &lt;!-- Enables the Spring MVC @Controller programming model --&gt;
  &lt;annotation-driven /&gt;
  
  &lt;!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory --&gt;
  &lt;resources mapping="/resources/**" location="/resources/" /&gt;
  
  &lt;!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory --&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;
  
  &lt;context:component-scan base-package="com.projects.model" /&gt;
  
  &lt;beans:bean id="dataSource"
      class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
  
      &lt;beans:property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
      &lt;beans:property name="url" value="jdbc:mysql://localhost:3306/customerdb" /&gt;
      &lt;beans:property name="username" value="root" /&gt;
      &lt;beans:property name="password" value="root" /&gt;
  &lt;/beans:bean&gt;
  
   &lt;beans:bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
      &lt;beans:property name="dataSource" ref="dataSource" /&gt;
      &lt;beans:property name="packagesToScan" value="com.projects.model" /&gt;
  
      &lt;beans:property name="hibernateProperties"&gt;
          &lt;beans:props&gt;
              &lt;beans:prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/beans:prop&gt;
              &lt;beans:prop key="hibernate.show_sql"&gt;true&lt;/beans:prop&gt;
          &lt;/beans:props&gt;
      &lt;/beans:property&gt;
  
      &lt;/beans:bean&gt;
  
  
  &lt;beans:bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
      &lt;beans:property name="sessionFactory" ref="sessionFactory" /&gt;
  &lt;/beans:bean&gt;
  </code></pre>
  
  <p></p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
  
  &lt;!-- The definition of the Root Spring Container shared by all Servlets and Filters --&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/spring/root-context.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;!-- Creates the Spring Container shared by all Servlets and Filters --&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;!-- Processes application requests --&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;appServlet&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/spring/appServlet/servlet-context.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;appServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Controller Class</p>
  
  <pre><code>package com.myprojects.controller;
  
  
  import java.util.Locale;
  
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.validation.BindingResult;
  import org.springframework.web.bind.annotation.ModelAttribute;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.servlet.ModelAndView;
  
  import com.projects.model.CustomerDao;
  import com.projects.model.Customer;
  
  
  @Controller
  public class HomeController {
  
  private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
  
  /**
   * Simply selects the home view to render by returning its name.
   */
  
  private CustomerDao dao;
  
  
  
  @RequestMapping(value = "/", method = RequestMethod.GET)        
  public String customer(Locale locale, Model model) {
      logger.info("Welcome home! The client locale is {}.", locale);
  
      return "home";
  }
  
  @RequestMapping(value = "/", method = RequestMethod.POST)
      public String addCustomer(@ModelAttribute("customer") Customer customer, BindingResult result) {
  
      dao.save(customer);
  
      return "home";
    }
  
  
  
  }
  </code></pre>
  
  <p>View Page(home.jsp)</p>
  
  <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  &lt;%@ page session="false" %&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Home&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
   &lt;P&gt;  The time on the server is ${serverTime}. &lt;/P&gt; --%&gt;
  
  &lt;form action="addCustomer"&gt;
  Cust_Id :
  &lt;input type="text"&gt;
  &lt;br&gt;
  Name :
  &lt;input type="text"&gt;
  &lt;br&gt;
  Age :
  &lt;input type="text"&gt;
  
  &lt;input type="submit" value="Save"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please help me resolve this.</p>
  
  <p>after i press the save button i get the following url gets called </p>
  
  <pre><code> http://localhost:8080/model/customer
  </code></pre>
  
  <p>and it throws the above mentioned error.</p>