title: Spring MVC submit via javascript (without button) to the correct handler
body: <p>I have this Controller :</p>
  
  <pre><code>@Controller
  @RequestMapping("/path/*")
  public class MyController {
  
      @RequestMapping(value = "/", method = RequestMethod.GET)
      public String welcomeHandler(final Model model) {
          // SOME CODE...
      }
  
      @RequestMapping(params = "reloadPage", value = "/", method = RequestMethod.POST)
      public String reloadPageHandler(final Model model) {
          // SOME CODE...
      }
  
      @RequestMapping(params = "search", value = "/", method = RequestMethod.POST)
      public String processSubmit(final BindingResult result...)
          // SOME CODE...
      }
  }
  </code></pre>
  
  <p>and this jsp :</p>
  
  <pre><code>&lt;form:form id="SearchFormController" method="post" modelAttribute="SearchFormBean"&gt;
      &lt;form:select path="searchCriteria.departmentId"&gt;
          &lt;form:options items="${addressDepartmentList}" itemValue="id" itemLabel="name" /&gt;
      &lt;/form:select&gt;
  
      &lt;p&gt;
          &lt;button type="submit" name="reloadPage"&gt;Reload the page&lt;/button&gt;
      &lt;/p&gt;
  
      &lt;form:select path="searchCriteria.cityId"&gt;
          &lt;form:options items="${addressCityList}" itemValue="id" itemLabel="name" /&gt;
      &lt;/form:select&gt;
  
      &lt;p&gt;
          &lt;button type="submit" name="search"&gt;Submit&lt;/button&gt;
      &lt;/p&gt;
  &lt;/form:form&gt;
  </code></pre>
  
  <p>This code works perfectly fine, when I click on the "Reload the page" button, the reloadPageHandler is called.</p>
  
  <p>Now what I want to achieve, is to remove this button and put an onchange event on my jsp like this :</p>
  
  <pre><code>&lt;form:select path="searchCriteria.departmentId" onchange="submit()"&gt;
      &lt;form:options items="${addressDepartmentList}" itemValue="id" itemLabel="name" /&gt;
  &lt;/form:select&gt;
  </code></pre>
  
  <p>The problem here is that when the form is submitted, it's the "processSubmit" handler that's called. But I have to call the "reloadPageHandler".</p>
  
  <p>Any idea on how to do this ? Thanks !</p>