title: Spring MVC cannot find method in controller when using POST request
body: <pre><code>I am new to spring and I am facing the following issue:
  </code></pre>
  
  <p>Edited Description:</p>
  
  <p>I was able to make a POST call by making a new controller and ModelAndView method but now I am facing one more problem of data not getting passed from JSP to controller.
      My JSP code is:</p>
  
  <pre><code>form:form method="POST" action="UserOperation"
          modelAttribute="DebitModel"&gt;
          &lt;h3&gt;Debit&lt;/h3&gt;
  
                      &lt;c:if test="${!empty listAccounts}"&gt;
                          &lt;select name="item" id="account_dropdown"
                              onchange="changeAccountDetails(this.options[this.selectedIndex].value)"&gt;
                              &lt;c:forEach items="${listAccounts}" var="account"&gt;
                                  &lt;option
                                      value="${account.accID},${account.acctype},${account.balance}"&gt;AccID:
                                      ${account.accID} Balance: ${account.balance}&lt;/option&gt;
                              &lt;/c:forEach&gt;
                          &lt;/select&gt;
                          &lt;br&gt;
                          &lt;br&gt;
                          &lt;label &gt;&lt;b&gt;Account ID: &lt;/b&gt;&lt;/label&gt;
                          &lt;label id="accIdText" path="accID"&gt;${listAccounts[0].accID}&lt;/label&gt;
                          &lt;label&gt;&lt;b&gt;Account Type: &lt;/b&gt;&lt;/label&gt;
                          &lt;label id="accTypeText" path="acctype"&gt;${listAccounts[0].acctype}&lt;/label&gt;
                          &lt;label&gt;&lt;b&gt;Balance: &lt;/b&gt;&lt;/label&gt;
                          &lt;label id="accBalText" path="balance"&gt;${listAccounts[0].balance}&lt;/label&gt;
                      &lt;/c:if&gt;
                      &lt;br&gt; &lt;br&gt; Enter Amount&lt;input type="text"
                          id="amount" width="80" path="amount"&gt;&lt;/input&gt; &lt;br&gt; &lt;br&gt;
          &lt;input type="submit" value="Debit"&gt;&lt;/input&gt;
      &lt;/form:form&gt;
  </code></pre>
  
  <p>There is a normal bean class named DebitModel.
  I tried to search and at many places for the data not getting passed and found solution as form:input mentioned but if I use this I get no Binding FoundException 'java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'DebitModel' available as request attribute
  ' even if &lt;%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> is present.</p>
  
  <pre><code>The Controller class Code:
  
  @Controller
  @RequestMapping(value = "/UserOperation")
  public class DebitController {
      @Autowired
      private AccountService mAccountService;
  
      @RequestMapping(method = RequestMethod.POST)
      public ModelAndView registerCustomer(@ModelAttribute("DebitModel") DebitModel debitModel, BindingResult result,
              HttpServletRequest request) throws NoSuchAlgorithmException, FileNotFoundException {
  
          ModelAndView modelAndView = new ModelAndView();
          System.out.println("data------------------------" + debitModel.toString());
          return modelAndView;
      }
  
  }
  </code></pre>