title: Handler method mappings with Spring 3.2.6
body: <p>I'm trying to learn web app development with Spring MVC framework and I'm not completely clear about how controller mappings work. It will be better if I show my config and code first and then explain what I don't understand.</p>
  
  <p>Here's mapping in my web.xml:</p>
  
  <pre><code>&lt;servlet&gt;
    &lt;servlet-name&gt;spring&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;spring&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>mapping in my controller class:</p>
  
  <pre><code>@Controller
  @RequestMapping("/main/courses")
  public class CourseController {
  ...
  </code></pre>
  
  <p>and mapping of the method in question in this controller:</p>
  
  <pre><code>@RequestMapping(value="", method = RequestMethod.GET)
      public String getCourses(Model model) {     
  ...
  </code></pre>
  
  <p>As you can see, <code>value</code> attribute is set to empty quotes and this is the only way this mapping works. If I change <code>value</code> attribute to <code>"/"</code>, I get 404 error. I have other mappings in this controller that work fine, for example <code>value="/add"</code>. The only problem is when I try to map to the root of this controller.</p>
  
  <p>Is <code>value=""</code> a valid value? Why <code>value="/"</code> doesn't work?</p>