title: Getting 404 error when making a request from Spring MVC
body: <p>i have created a war file and kept it inside webapps directory in tomcat and starting the tomcat but when i am hitting <strong><a href="http://localhost:8181/HelloWeb/hello" rel="nofollow">http://localhost:8181/HelloWeb/hello</a></strong> i am getting 404 error. i am new to spring mvc any help will be appreciated. Below are my files (doing the example given in <a href="http://www.tutorialspoint.com/spring/spring_mvc_hello_world_example.htm" rel="nofollow">http://www.tutorialspoint.com/spring/spring_mvc_hello_world_example.htm</a>.</p>
  
  <p>HelloController.java </p>
  
  <pre><code>package dummyPackageOne;
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.ModelMap;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  @Controller
  @RequestMapping("/hello")
  public class HelloController {
  
  
  
  @RequestMapping(method=RequestMethod.GET)
  public String printHello(ModelMap modelMap){
  
      modelMap.addAttribute("message", "this is the message");
      return "hello";
      }
  }
  </code></pre>
  
  <p>this is my hello.jsp</p>
  
  <pre><code>&lt;%@ page contentType="text/html; charset=UTF-8" %&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Hello World&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
     &lt;h2&gt;${message}&lt;/h2&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>HelloWeb-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="dummyPackageOne" /&gt;
    &lt;bean  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;
  
    &lt;/beans&gt;
  </code></pre>
  
  <p>web.xml</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"  xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 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;springTest&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;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;/web-app&gt;
  </code></pre>