title: Spring 4 : How to map RequestMapping URLs to particular controller
body: <p>I have written a Spring MVC application with multiple controllers.  </p>
  
  <p>On the JSP, I have the <code>action</code> on the form:</p>
  
  <pre><code> &lt;form id="createTableForm" method="post" name="createTable" action="${pageContext.request.contextPath}/saveTable" &gt;
  </code></pre>
  
  <p>and the same action is mapped to a method in the Controller: </p>
  
  <pre><code>@Controller
  public class TableController implements TableConstants {
  
    @RequestMapping(value="/saveTable")
    public String saveTable(HttpServletRequest request,RedirectAttributes redirectAttributes) {
    //...
    }
  }
  </code></pre>
  
  <p>And in my <code>web.xml</code>:</p>
  
  <pre><code>  &lt;context-param&gt;
      &lt;description&gt;Context name of the Application&lt;/description&gt;
      &lt;param-name&gt;contextName&lt;/param-name&gt;
      &lt;param-value&gt;W****&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;description&gt;Database used for&lt;/description&gt;
      &lt;param-name&gt;databaseName&lt;/param-name&gt;
      &lt;param-value&gt;w*****&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;login.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  
  &lt;filter&gt;
      &lt;filter-name&gt;FilterChainProxy&lt;/filter-name&gt;
      &lt;filter-class&gt;com.abc.w****.configuration.FilterChainProxy
      &lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;FilterChainProxy&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  &lt;session-config&gt;
      &lt;session-timeout&gt;1&lt;/session-timeout&gt;
  &lt;/session-config&gt;
  
  
  &lt;jsp-config&gt;
      &lt;taglib&gt;
          &lt;taglib-uri&gt;http://displaytag.sf.net&lt;/taglib-uri&gt;
          &lt;taglib-location&gt;/WEB-INF/tld/displaytag.tld&lt;/taglib-location&gt;
      &lt;/taglib&gt;
  &lt;/jsp-config&gt;
  </code></pre>
  
  <p> </p>
  
  <p>Do I need to include the URL mapping to that particular Controller in the <code>web.xml</code> file or in the <code>WebAppConfig</code> class?</p>
  
  <p>I have the <code>WebAppConfig</code> annotated with @Configuration, @ComponentScan and @EnableWebMVC.  It has the following methods:</p>
  
  <pre><code> public UrlBasedViewResolver setupViewResolver() {
   }
   public MessageSource messageSource() {
   }
   public void addResourceHandlers(ResourceHandlerRegistry registry) {
   }
   public CommonsMultipartResolver multipartResolver() { 
   }
  </code></pre>
  
  <p>Please advise.</p>