title: WARNING: No mapping found for HTTP request with URI [] in DispatcherServlet with name 'dispatcher'
body: <p>I am just started to implement simple Spring REST api application. My web.xml file looks like as following.</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"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
  id="WebApp_ID" version="3.0"&gt;
  
  
  &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&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;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/dispatcher-servlet.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;
          org.springframework.web.context.ContextLoaderListener
      &lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p></p>
  
  <p>And this is my dispatcher-servlet.xml</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
  http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  http://www.springframework.org/schema/context
  http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
  &lt;context:component-scan base-package="com.suntravel.service.controller" /&gt;
  
  &lt;bean
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="prefix"&gt;
          &lt;value&gt;/WEB-INF/&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="suffix"&gt;
          &lt;value&gt;.jsp&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p></p>
  
  <p>And here is my SunTravelController.java class.</p>
  
  <pre><code>package com.suntravel.service.controller;
  
  import org.springframework.web.bind.annotation.PathVariable;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RestController;
  
  @RestController
  @RequestMapping("/suntravel")
  public class SunTravelController
  {
   @RequestMapping(value = "/{name}", method = RequestMethod.GET, produces = "application/json")
  public String getHotelList( @PathVariable String name )
  {
      return name;
  
  }
  
  }
  </code></pre>
  
  <p>Then I deployed this in tomcat server and trying to access <a href="http://localhost:8080/SpringRestServer/suntravel?Bob" rel="nofollow noreferrer">http://localhost:8080/SpringRestServer/suntravel?Bob</a></p>
  
  <p>Then I am getting following error in my console log.</p>
  
  <pre><code>WARNING: No mapping found for HTTP request with URI [/SpringRestServer/suntravel] in DispatcherServlet with name 'dispatcher'
  </code></pre>
  
  <p>Project Structure</p>
  
  <p><a href="https://i.stack.imgur.com/tQM7P.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tQM7P.png" alt="enter image description here"></a></p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks</p>