title: Spring MVC4 No mapping found for HTTP request with URI Using maven
body: <p>I am creating a Spring4 MVC application using maven
  taking "<strong>maven-archetype-webapp</strong>" as artifactId and
  adding dependencies "Spring-core","spring-web","Spring-mvc"
  below is the "web.xml" &amp; "HelloWeb-servlet.xml"</p>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"&gt;
  &lt;display-name&gt;Spring MVC Application&lt;/display-name&gt;
  &lt;servlet&gt;
    &lt;servlet-name&gt;HelloWeb&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;HelloWeb&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>HelloWeb-servlet.xml</strong></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"
   xmlns:mvc="http://www.springframework.org/schema/mvc"
   xsi:schemaLocation="http://www.springframework.org/schema/beans   
   http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
   http://www.springframework.org/schema/context 
   http://www.springframework.org/schema/context/spring-context-4.0.xsd
   http://www.springframework.org/schema/mvc
   http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd"&gt;
  
  &lt;context:component-scan base-package="com.zap.pm.*" /&gt;
  &lt;mvc:annotation-driven /&gt;
  &lt;bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
      &lt;property name="suffix" value=".jsp" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p></p>
  
  <p>and my controller class is as bellow</p>
  
  <pre><code>package com.zap.pm;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.servlet.ModelAndView;
  
  @Controller
  public class HelloController{
  
  @RequestMapping( value="/test")
  public String printHello() {
      ModelAndView model=new ModelAndView();
    model.addAttribute("message", "Hello Spring MVC Framework!");
    return "hello";
    }
  }
  </code></pre>
  
  <p>I have placed the hello.jsp inside the "/WEB-INF/jsp/" 
  but when accessing the request "<a href="http://localhost:8080/webappspring/test.html" rel="nofollow">http://localhost:8080/webappspring/test.html</a>"
  it is giving the following error</p>
  
  <pre><code>Oct 12, 2015 7:10:13 PM     org.springframework.web.servlet.DispatcherServlet noHandlerFound
  WARNING: No mapping found for HTTP request with URI [/webappspring/test.html] in DispatcherServlet with name 'HelloWeb'
  </code></pre>
  
  <p>I have visited the slimier question here but none is solving my problem.</p>