1
我在JSP文件中的一個片段如下thymeleaf設定值ATTR輸入標籤
<c:forEach var="question" items="${questionList }">
<p>{{ question.question }}</p>
<c:forEach var="answer" items="${question.answerList }">
<input type="radio" name="${question.id }" id="${answer.id }" value="${answer.sequence }">
<label for="${answer.id }">${answer.answer }</label>
</c:forEach>
</c:forEach>
現在我用thymeleaf模板,我不知道如何實現它在百里香。尤其是,我卻不知道怎麼去name
ATTR爲input
,
<div th:each="answer : ${question.answerList }">
<input type="radio" name="how to do?" id="how to do?" value="how to do?" th:value="${answer.sequence}">
<label th:text="${ans.answer}"></label>
</div>
謝謝,但現在我已經從我的項目中刪除了thymeleaf並添加了jsp。 –