title: Spring: get input button id
body: <p>I have this html template in thymeleaf.</p>
  
  <pre><code>&lt;table id="listAllAccountantTable" th:cellspacing="0" class="table table-striped table-bordered" style="width:100%;"&gt;
    &lt;thead&gt;
    &lt;tr&gt;
       &lt;th&gt;No. &lt;/th&gt;
       &lt;th&gt;Registered Date&lt;/th&gt;
       &lt;th&gt;Status&lt;/th&gt;
       &lt;th&gt;Name&lt;/th&gt;
       &lt;th&gt;Email&lt;/th&gt;
       &lt;th&gt;Contact No.&lt;/th&gt;
       &lt;th&gt;IC No.&lt;/th&gt;
       &lt;th&gt;IC attachment&lt;/th&gt;
       &lt;th&gt;Actions &lt;/th&gt;
    &lt;/tr&gt;
  
    &lt;tr th:each="acc,iterationStatus  : ${accountantListing}"&gt;
       &lt;td th:text="${iterationStatus.count}"&gt;1&lt;/td&gt;
       &lt;td th:text="${acc.currentTimeStamp}"&gt;&lt;/td&gt;
       &lt;td th:text="${acc.active}"&gt;1&lt;/td&gt;
       &lt;td th:text="${acc.name}"&gt;Name&lt;/td&gt;
       &lt;td th:text="${acc.email}"&gt;Email&lt;/td&gt;
       &lt;td th:text="${acc.phoneNumber}"&gt;Contact No.&lt;/td&gt;
       &lt;td th:text="${acc.icNumber}"&gt;IC No.&lt;/td&gt;
       &lt;td th:text="${acc.id}"&gt; To be fixed: upload IC image&lt;/td&gt;
  
       &lt;td&gt;
          &lt;form action="#" data-th-action="@{/accountantApplication}" method="post"&gt;                                                   
             &lt;button type="submit" name="action" th:id="${acc.id}" 
                value="Accept"&gt;Accept&lt;/button&gt;
             &lt;button type="submit" name="action" th:id="${acc.id}" 
                value="Reject"&gt;Reject&lt;/button&gt;
          &lt;/form&gt;
       &lt;/td&gt;
    &lt;/tr&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>My Spring controller is:</p>
  
  <pre><code>@RequestMapping(value="/accountantApplication", method=RequestMethod.POST, params="action=Accept")
  public ModelAndView Accept() {
      ModelAndView modelAndView = new ModelAndView();
      System.out.println("######## Accepting accountant");
      modelAndView.setViewName("AccountantListing");
      return modelAndView;
  }
  
  
  @RequestMapping(value="/accountantApplication", method=RequestMethod.POST, params="action=Reject")
  public ModelAndView Reject() {
      ModelAndView modelAndView = new ModelAndView();
      System.out.println("######## Rejecting accountant");
      modelAndView.setViewName("AccountantListing");
      return modelAndView;
  }
  </code></pre>
  
  <p>The table shows a list of accountants. 
  All accountants are loaded from db and displayed on the table.
  They need to be accepted or rejected.
  When I click the accept button, Accept() is called.
  How do I get the ID attached to button?</p>
  
  <p>Or if there is better way of immplementing this. let me know too. Thanks so much</p>