title: Why does the handler method not get found?
body: <p>I want to expose a simple REST API besides my GWT WebApplication using <code>org.springframework.web.bind.annotation.RestController</code>. I therefore added another servlet to my <strong>web.xml</strong> and mapped it to <code>/app/restapi/*</code>:</p>
  
  <pre><code>&lt;!-- ... --&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;xsrf&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.google.gwt.user.server.rpc.XsrfTokenServiceServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;xsrf&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/app/xsrf&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;!-- New servlet for my REST API --&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;mobile-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;mobile-dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/app/restapi/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>This is the controller that should handle the requests:</p>
  
  <pre><code>@RestController
  @RequestMapping("/app/restapi")
  public class RestaurantController {
  
      class ReturnValue {
          public String str = "1337";
      }
  
      @ResponseStatus(HttpStatus.OK)
      @RequestMapping(value = "/test", method = RequestMethod.GET, produces = { "application/json" })
      public ReturnValue getTest() {
          return new ReturnValue();
      }
  }
  </code></pre>
  
  <p>The problem is that requesting <code>http://localhost:8080/app/restapi/test</code> gives me just:</p>
  
  <pre><code>16:14:22.497 [http-bio-8080-exec-8] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'mobile-dispatcher' processing GET request for [/app/restapi/test]
  16:14:22.497 [http-bio-8080-exec-8] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /test
  16:14:22.497 [http-bio-8080-exec-8] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Did not find handler method for [/test]
  16:14:22.497 [http-bio-8080-exec-8] WARN  o.s.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/app/restapi/test] in DispatcherServlet with name 'mobile-dispatcher'
  16:14:22.497 [http-bio-8080-exec-8] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request
  </code></pre>
  
  <p>and I don't know why. So: What am I doing wrong here and how can I make this work as intended?</p>