title: Spring MVC 3.2.4 @RequestMapping don't work
body: <p>Try to create restful service with spring mvc, but can't get access to it. After read tons of answers here all seems right, maybe you can see something.</p>
  
  <pre><code>21.09.2013 10:50:33 org.springframework.web.servlet.DispatcherServlet noHandlerFound
  WARNING: No mapping found for HTTP request with URI [/rest/book] in DispatcherServlet with name 'mvc-dispatcher'
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&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_3_0.xsd"
           version="3.0" metadata-complete="true"&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;mvc-dispatcher&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;contextClass&lt;/param-name&gt;
              &lt;param-value&gt;
                  org.springframework.web.context.support.AnnotationConfigWebApplicationContext
              &lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;
                  ru.expbrain.flib.config.RestConfig
              &lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.hmtl&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>RestConfig.java</p>
  
  <pre><code>package ru.expbrain.flib.config;
  
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.web.servlet.config.annotation.EnableWebMvc;
  import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
  
  @Configuration
  @EnableWebMvc
  @ComponentScan(basePackages = {"ru.expbrain.flib.rest.controller"})
  public class RestConfig  extends WebMvcConfigurerAdapter {
  
  }
  </code></pre>
  
  <p>BookController.java</p>
  
  <pre><code>package ru.expbrain.flib.rest.controller;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RequestParam;
  import org.springframework.web.bind.annotation.ResponseBody;
  import ru.expbrain.flib.rest.entity.Book;
  
  import java.util.concurrent.atomic.AtomicLong;
  
  @Controller
  public class BookController {
  
      private final AtomicLong counter = new AtomicLong();
  
      @RequestMapping(value="/book", method = RequestMethod.GET)
      public @ResponseBody Book greeting(@RequestParam(value="content", required=false, defaultValue="World") String name) {
          return new Book(counter.incrementAndGet(), name);
      }
  }
  </code></pre>
  
  <p>Try to get content over path, btw root context path go to /</p>
  
  <pre><code>http://localhost:9080/rest/book
  </code></pre>