title: Spring MVC WARNING: No mapping found for HTTP request with URI
body: <p>My <code>web.xml</code> content is:</p>
  
  <pre><code>&lt;servlet&gt;
          &lt;servlet-name&gt;springDispatcher&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;springDispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt; &lt;!-- Why not put / instead of *.html? --&gt;
      &lt;/servlet-mapping&gt;
  
  
      &lt;!-- ContextLoader --&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;
              /WEB-INF/conf/applicationContext.xml
              /WEB-INF/conf/applicationContext-data.xml
              /WEB-INF/conf/applicationContext-service.xml
  
          &lt;/param-value&gt;
      &lt;/context-param&gt;
  </code></pre>
  
  <p>My <code>applicationContext.xml</code> is:</p>
  
  <pre><code>&lt;!-- Default ViewResolver --&gt;
  &lt;bean
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"
      p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" /&gt;
  &lt;bean id="multipartResolver"
      class="org.springframework.web.multipart.commons.CommonsMultipartResolver" /&gt;
  
  &lt;context:annotation-config /&gt;
  
  &lt;context:component-scan base-package="com.lftechnology.controller" /&gt;
  
  &lt;!-- &lt;bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" 
      /&gt; --&gt;
  
  &lt;bean
      class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /&gt;
  
  &lt;bean class="com.lftechnology.controller.EmployeeController"&gt;
      &lt;property name="employeeService" ref="employeeService" /&gt;
      &lt;property name="departmentService" ref="departmentService"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Finally the controller is:</p>
  
  <pre><code>@Controller
  public class EmployeeController {
  
      EmployeeService employeeService;
      DepartmentService departmentService;
  
      //getters setters    
  
      @RequestMapping("/deleteEmployee.htm")
      public String deleteEmployee(HttpServletRequest request,
              HttpServletResponse response) throws Exception {
          //
          return "redirect:viewEmployee";
      }
  
      @RequestMapping("/viewEmployee.htm")
      public ModelAndView viewEmployee(HttpServletRequest request,
              HttpServletResponse response) throws Exception {
  
          Map&lt;String, Object&gt; model = new HashMap&lt;String, Object&gt;();
          //
          return new ModelAndView("viewEmployee", "model", model);
      }
  
  }
  </code></pre>
  
  <p><strong>Exception:</strong></p>
  
  <pre><code> org.springframework.web.servlet.DispatcherServlet noHandlerFound
  WARNING: No mapping found for HTTP request with URI [/springEmployeeAnotations/viewEmployee.htm] in DispatcherServlet with name 'springDispatcher' 
  </code></pre>
  
  <p>I don't know what is wrong with this code. Everything seems right to me at least. The exception is caused when trying to get into <code>viewEmployee</code> method of the controller.Any help?</p>