我需要将动态转换HTML
为Thymeleaf
模板Spring boot
。
下面是动态添加两个字段的javascript。
如何在 Thymeleaf 中映射它们?
function add() {
var element = document.createElement("input");
var foo = document.getElementById("fooBar");
foo.appendChild(element);
}
<input type="button" value="Add" onclick="add()"/>
我有一个PoJo
映射输入数据。如何制作Thymeleaf
模板以将此数据映射到PoJo
.
例如:假设表格包含学生姓名和年龄字段。我想添加更多学生数据。喜欢:S1 20 S2 21 S3 25
我需要使用 Thymeleaf 发布这些数据,如何做到这一点?服务器上有学生类。