表单未提交POST

时间:2020-04-05 08:31:44

标签: html twitter-bootstrap thymeleaf

我的Spring Boot / Thymeleaf / Bootstrap应用程序中有以下表格:

<form action="/person" method="POST">
<div class="form-group">
    <label for="name">Name</label>
    <input type="text" class="form-control" id="name">
</div>
<button type="submit" class="btn btn-primary">Create</button></form>

现在的问题是,当我提交表单时,它只向“ /?”发出GET请求。 url,而不是发布到“ / person”。

该行为可能是什么原因?

1 个答案:

答案 0 :(得分:0)

<form action="/person" method="post">
     <div class="form-group">
          <label for="name">Name</label>
          <input type="text" class="form-control" id="name">
     </div>
     <input type="submit" class="form-submit">
 </form>