title: Request mapping - Spring 4 - doesn't work
body: <p>I have a very simple problem. When in my .jsp files I have a link to **/registration the method viewRegistration is executed and everything is working fine. If I have a link to **/registration/getTags?tagName=blahblah page is not found. I have no idea why, because I think my requestMapping annotation looks correct... I would be very grateful for your help!</p>
  
  <p>CONTROLLER:</p>
  
  <pre><code>@Controller
  @RequestMapping(value = "/registration")
  public class HelloController {
  
      final static Logger logger = Logger.getLogger(HelloController.class);
  
      @RequestMapping(method = RequestMethod.GET)
      public String viewRegistration(Map&lt;String, Object&gt; model, HttpSession session) {
          ...
     }
  
  @RequestMapping(value = "/getTags", method = RequestMethod.GET)
      public @ResponseBody
      List&lt;Tag&gt; getTags(@RequestParam String tagName) {
  
          ....
  
      }
  }
  </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" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"&gt;
    &lt;display-name&gt;aa&lt;/display-name&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;xxx&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;xxx&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/registration/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/xxx-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;/web-app&gt;
  </code></pre>
  
  <p>xxx-servlet.xml :</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:mvc="http://www.springframework.org/schema/mvc"
      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  
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;
  
      &lt;context:component-scan base-package="movies.controller" /&gt;
      &lt;context:property-placeholder location="/WEB-INF/properties/website.properties" /&gt;
      &lt;context:component-scan base-package="com" /&gt;
      &lt;context:annotation-config /&gt;
      &lt;mvc:annotation-driven /&gt;
  
      &lt;bean class="org.springframework.web.servlet.view.tiles3.TilesConfigurer"
          id="tilesConfigurer"&gt;
          &lt;property name="definitions"&gt;
              &lt;list&gt;
                  &lt;value&gt;/WEB-INF/tile/tilesJsp.xml&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      &lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt;
      &lt;bean class="org.springframework.web.servlet.view.UrlBasedViewResolver"
          id="viewResolver"&gt;
          &lt;property name="viewClass"
              value="org.springframework.web.servlet.view.tiles3.TilesView" /&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="messageSource"
          class="org.springframework.context.support.ResourceBundleMessageSource"&gt;
          &lt;property name="basename" value="website" /&gt;
      &lt;/bean&gt;
  
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>EDIT EDIT EDIT:
  I even tried sth more simple:</p>
  
  <pre><code>@RequestMapping(value = "/getTags")
      @ResponseBody
      public List&lt;Tag&gt; getTags() {
          String tagName="";
          return simulateSearchResult(tagName);
  
      }
  </code></pre>
  
  <p>but still /registration/getTags does not work..., page not found.</p>