【发布时间】:2022-01-22 21:15:00
【问题描述】:
我正在使用 Thymeleaf 作为模板引擎编写一个带有 CRUD 操作的简单 Web 应用程序。问题是,这是我的代码:
<form th:method="POST" th:action="@{/}">
<div>
<ul th:each="balloon: ${balloons}" style="list-style-type: none">
<li>
<input type="radio" name="balloonType" th:text="${balloon.getName()}"
th:value="${balloon.getDescription()}">
</li>
<div>
<form th:method="POST" th:action="@{'/balloons/delete/{id}' (id=${balloon.getId()})}">
<input type="submit" value="Delete">
</form>
</div>
</ul>
<input type="submit" value="Submit">
</div>
<br/>
</form>
当我运行应用程序时,inspect 元素中的代码如下图所示。第一个删除按钮不会以自己的形式出现,因此无法正常工作。欢迎任何帮助。
【问题讨论】:
标签: java spring spring-mvc thymeleaf