title: Spring MVC No mapping found for HTTP request with URI /x/ in DispatcherServlet
body: <p>I've seen this post with no solutions.  I'm trying to run a Spring MVC tutorial but for some reason I'm not able to get the mapping in my servlet to call my home.jsp found in /WEB-INF/jsps directory.  My context root is set to spring in Eclipse Web Project Settings.  The error I'm getting is:</p>
  
  <pre><code>    INFO    2016-11-06 11:18:59,613 [http-bio-8080-exec-3] 
        org.springframework.web.servlet.DispatcherServlet  - 
        FrameworkServlet 'offers': initialization completed in 486 ms
      WARN    2016-11-06 11:18:59,623 [http-bio-8080-exec-3] 
       org.springframework.web.servlet.PageNotFound  
       - No mapping found for HTTP request with URI [/spring/] 
       in DispatcherServlet with name 'offers'
  </code></pre>
  
  <p>My code is as follows:</p>
  
  <p>web.xml:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
               xmlns="http://java.sun.com/xml/ns/javaee" 
               xmlns:web="http://java.sun.com/xml/ns/javaee" 
               xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" 
          version="2.5"&gt;
        &lt;display-name&gt;spring-tutorial-50&lt;/display-name&gt;
        &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
          &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
          &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
          &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
          &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
        &lt;/welcome-file-list&gt;
        &lt;servlet&gt;
          &lt;description&gt;&lt;/description&gt;
          &lt;display-name&gt;offers&lt;/display-name&gt;
          &lt;servlet-name&gt;offers&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;web:load-on-startup&gt;1&lt;/web:load-on-startup&gt;
        &lt;/servlet&gt;
        &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;offers&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
        &lt;/servlet-mapping&gt;
      &lt;/web-app&gt;
  </code></pre>
  
  <p>offers-servlet.xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:context="http://www.springframework.org/schema/context"
          xmlns:mvc="http://www.springframework.org/schema/mvc"
          xsi:schemaLocation="http://www.springframework.org/schema/mvc 
            http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
            http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context 
            http://www.springframework.org/schema/context/spring-context-
             3.2.xsd"&gt;
  
          &lt;context:component-scan base-package="com.mypackage.spring.web.controllers"&gt;
          &lt;/context:component-scan&gt;
          &lt;mvc:annotation-driven /&gt;
  
          &lt;bean id="jspViewResolver"
              class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
              &lt;property name="prefix" value="/WEB-INF/jsps/"&gt;&lt;/property&gt;
              &lt;property name="suffix" value=".jsp"&gt;&lt;/property&gt;
          &lt;/bean&gt;
  
      &lt;/beans&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>    @Controller
      public class OffersController {
  
          private Logger log = Logger.getLogger(OffersController.class);
  
          @RequestMapping("/")
          public String showHome(){
  
              log.info("showHome() called"); 
              return "home";
  
          }
      }
  </code></pre>
  
  <p>home.jsp</p>
  
  <pre><code>    &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
          pageEncoding="ISO-8859-1"%&gt;
      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
         "http://www.w3.org/TR/html4/loose.dtd"&gt;
      &lt;html&gt;
      &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
      &lt;title&gt;Inside jsps&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
      Hi Mom!
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>