java Thymeleaf隐藏输入值始终为空
我试图在表单中放入带值的隐藏inmput,但该字段始终为空
<form th:action="@{/user/subject/join}" th:object="${joinSubjectDTO}" method="post">
<table>
<tr>
<td>Password to subject:</td>
<td><input type="password" th:field="*{password}" /></td>
<td><input type="hidden" th:field="*{subjectId}" th:value="${subject.id}"/></td>
</tr>
<tr>
<td><button type="submit">Join</button></td>
</tr>
</table>
</form>
有人能帮我解决这个问题吗
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class JoinSubjectDTO {
private Integer subjectId;
private String password;
}
我要把JoinSubjectd加入课堂
共 (0) 个答案