title: RequestMapping doesnt work
body: <p>please help me with not difficult problem. I want just try something with @RequestMapping annotation in my project. I created WebController.java, which has  </p>
  
  <pre><code>  package com.mycompany.controller.controller;
  
      import org.springframework.stereotype.Controller;
      import org.springframework.web.bind.annotation.RequestMapping;
      import org.springframework.web.bind.annotation.RequestMethod;
      import org.springframework.web.servlet.ModelAndView;
  
      @Controller
      @RequestMapping("/welcome")
      public class WebController{
  
          @RequestMapping(method = RequestMethod.GET)
          public ModelAndView helloWorld(){
  
              ModelAndView model = new ModelAndView("HelloWorldPage");
              model.addObject("msg", "hello world");
  
              return model;
          }
      }
  </code></pre>
  
  <p>and HelloWorldPage.jsp</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  ${msg }
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>springmvc-servlet.xml (other controllers and web app works fine)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:jee="http://www.springframework.org/schema/jee"
      xmlns:lang="http://www.springframework.org/schema/lang"
      xmlns:p="http://www.springframework.org/schema/p"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xmlns:util="http://www.springframework.org/schema/util"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
          http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
          http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
          http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"&gt;
  
       &lt;context:annotation-config /&gt;
  
      &lt;context:component-scan base-package="com.mycompany.controller" /&gt;
  
      &lt;bean name="/countrylist.html" class="com.mycompany.controller.controller.CountryController"/&gt;
      &lt;bean name="/citylist.html" class="com.mycompany.controller.controller.CityController"/&gt;
      &lt;bean name="/successcitysearch.html" class="com.mycompany.controller.controller.CitiesOfCountryController"/&gt;
  
      &lt;bean name="/addcountry.html" class="com.mycompany.controller.controller.AddCountryController"&gt;
      &lt;property name="commandClass" value="com.mycompany.model.domain.Country"/&gt;
      &lt;property name="formView" value="addcountry"/&gt;
      &lt;property name="successView" value="countrylist.html"/&gt;
      &lt;/bean&gt;
  
      &lt;bean name="/addcity.html" class="com.mycompany.controller.controller.AddCityController"&gt;
      &lt;property name="commandClass" value="com.mycompany.model.domain.City"/&gt;
      &lt;property name="formView" value="addcity"/&gt;
      &lt;property name="successView" value="citylist.html"/&gt;
      &lt;/bean&gt;
      &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/&gt;
          &lt;property name="prefix" value="/jsp/"/&gt;
          &lt;property name="suffix" value=".jsp"/&gt;
      &lt;/bean&gt;
  
  
  
      &lt;bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
          p:location="/WEB-INF/jdbc.properties" /&gt;
  
      &lt;bean id="dataSource"
          class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
          p:driverClassName="${jdbc.driverClassName}"
          p:url="${jdbc.databaseurl}" p:username="${jdbc.username}"
          p:password="${jdbc.password}" /&gt;
  
  
      &lt;bean id="sessionFactory"
          class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
          &lt;property name="configLocation"&gt;
              &lt;value&gt;/WEB-INF/hibernate.cfg.xml&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="configurationClass"&gt;
              &lt;value&gt;org.hibernate.cfg.AnnotationConfiguration&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;${jdbc.dialect}&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;tx:annotation-driven /&gt;
      &lt;bean id="transactionManager"
          class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory" ref="sessionFactory" /&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 version="2.4"
           xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
           http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" &gt;
  
    &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/springmvc-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;
    &lt;servlet&gt;
      &lt;servlet-name&gt;springmvc&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;springmvc&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;
        index.jsp
      &lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>So when I try write link localhost/MyCountryProject/welcome or localhost/MyCountryProject/welcome.html It gives me 404 error resource not available. Please help me, thanks!</p>