title: spring-mvc - No mapping found for HTTP request with URI
body: <p>I know that there were dozens of similar topics, but I couldn't find solution in any of it. I want to make simple 'hello world' app using spring mvc.
  It gives me 404 with description: The requested resource is not available. In the console:</p>
  
  <pre><code>wrz 13, 2013 7:38:14 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
  WARNING: No mapping found for HTTP request with URI [/gitsystem/] in DispatcherServlet with name 'dispatcher'
  </code></pre>
  
  <p><strong>Controller.java:</strong></p>
  
  <pre><code>package bg.glowacki.gitsystem.controller;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.web.bind.annotation.RequestMapping;
  
  @Controller
  public class Controller {
  
      @RequestMapping("/")
      public String printHelloWorld(Model model) {
          model.addAttribute("message", "Hello World!");
  
          return "helloWorld";
      }
  }
  </code></pre>
  
  <p><strong>dispatcher-servlet.xml</strong></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:p="http://www.springframework.org/schema/p"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:mvc="http://www.springframework.org/schema/mvc"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-3.2.xsd
          http://www.springframework.org/schema/mvc
          http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"&gt;
  
      &lt;context:component-scan base-package="bg.glowacki.gitsystem.controller" /&gt;
      &lt;mvc:annotation-driven /&gt;
  
      &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="prefix" value="/WEB-INF/pages/" /&gt;
          &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app 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"
  version="2.5"&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&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;dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>Request</strong></p>
  
  <pre><code>GET /gitsystem/ HTTP/1.1 
  Host: localhost:8080 
  Connection: keep-alive 
  Cache-Control: max-age=0 
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 
  User-Agent: Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36 
  Accept-Encoding: gzip,deflate,sdch 
  Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
  </code></pre>