title: How to handle two different submit operation from same form in a spring controller
body: <p>I have two submit buttons in my JSP add,remove. I don't really know how to differentiate the operations in the controller side.</p>
  
  <pre><code>&lt;form:form modelAttribute="emp" action="/empl" method="POST"&gt; 
      &lt;input type="submit" name="operation" value="Remove"/&gt;
      &lt;input type="submit" name="operation" value="Add" /&gt;
  &lt;/form:form&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>@RequestMapping(value = "/empl", method = RequestMethod.POST)
  public String getD(@Valid Em form, BindingResult result, Model model) {//code}
  </code></pre>
  
  <p>Onclick of the either button posts values correctly along with "operation Add" or "operation Remove" respectively and then add works because that is the default method being called. Now how do i catch the operation parameter and differentiate the operation and use it?</p>