title: Unable to find controller in spring web mvc
body: <p>It seems that dispatcher-servlet unable to perform component scan using.</p>
  
  <pre><code> &lt;context:component-scan  base-package="abc" /&gt;
  </code></pre>
  
  <p>In my controller file (<strong>HelloController.java</strong>) under package <strong>abc</strong>. Code is written as follows:</p>
  
  <pre><code>@Controller
  @RequestMapping("/hello")
  public class HelloController {
  
  @RequestMapping(method = RequestMethod.GET)
  public String printHello(ModelMap model) {
      model.addAttribute("message", "Hello Spring MVC Framework!");
      return "hello"; //I have already made hello.jsp in web-inf/jsp/
   }
  }
  </code></pre>
  
  <p>My Application name is <strong>SpringMiddle</strong>. When try url as:</p>
  
  <pre><code>http://localhost:8080/SpringMiddle/hello.htm
  </code></pre>
  
  <p>I do have following url pattern in web.xml</p>
  
  <pre><code> &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>It shows me error HTTP 404 not found.</p>
  
  <p><strong>EDIT:</strong> : it shows me warning </p>
  
  <pre><code>WARNING:   No mapping found for HTTP request with URI [/SpringMiddle/hello.htm] in DispatcherServlet with name 'dispatcher'
  </code></pre>