title: HTTP Status 405 - Request method 'GET' not supported occurs when calling a delete request
body: <p>I am trying to implement delete action for the each datatable row by invoking a bootstrap modal. And then sending a delete request to the controller with the parameter of username. </p>
  
  <pre><code>   $(document).ready(function () {
      $('#usersTable').DataTable({
          "sAjaxSource": "users/list",
          "sAjaxDataProp": "",
          "aoColumns": [
              {"mData": "username"},
              {"mData": "firstName"},
              {"mData": "lastName"},
              {"mData": "status"},
              {"mData": "role.roleName"},
              {
                  mRender: function (data, type, row) {
  
                      var linkDel = "&lt;a href=\"#\" onclick=\"fillDeleteFrm(\'username\')\"&gt;Delete&lt;/a&gt;";
                      linkDel = linkDel.replace("id", row.id);
                      linkDel = linkDel.replace("name", row.name);
                      return linkDel;
                  }
              }
          ]
      })
  });
  
     function fillDeleteFrm(username) {
      $('#delete-username').val(username);
      $('#userDeleteModal').modal('toggle');
      return false;
  }
  </code></pre>
  
  <p>The thymeleaf form that calls the spring controller :</p>
  
  <pre><code>        &lt;div id="userDeleteModal"&gt;
              &lt;form id="systemUserForm" th:action="@{/userdelete}" th:method="delete"&gt;
                      &lt;input type="hidden" id="delete-username" name="username" th:value="*{username}"&gt;
                          &lt;button type="submit" class="btn btn-primary"&gt;Delete&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
  </code></pre>
  
  <p>The corresponding spring controller : </p>
  
  <pre><code>    @ResponseBody
      @RequestMapping(value="/userdelete", method = RequestMethod.DELETE)
      public ModelAndView deleteEmployee(@RequestParam String username) {
      User user = userService.findUserByUserName(username);
      userService.deleteUser(user);
      return new ModelAndView("users");
    }
  </code></pre>
  
  <p>Even though I call the delete request method the mapping does not route to this controller, alerting </p>
  
  <pre><code>HTTP Status 405 - Request method 'GET' not supported
  </code></pre>
  
  <p>What would I have done wrong? Thanks in advance. </p>