select根據後臺集合顯示下列列表前端
<select class="form-control" name="parentId" > <option ></option> <option th:each="a : ${menus}" th:text="${a.name}" th:value="${a.parentId}">
</select>
radio根據後臺的值選中對應的數據java
<div class="form-group form-inline"> <div class="radio"><label><input type="radio" th:field="${user.gender}" name="gender" th:value="0">男</label></div> <div class="radio"><label><input type="radio" th:field="${user.gender}" name="gender" th:value="1">女</label></div> </div>
文字回顯:例如前端要根據返回的值顯示 男或女,我這裏用的th:switch,其餘的例如th:if沒成功。spa
<td th:switch="${user.gender}"> <p th:case="0">男</p> <p th:case="1">女</p> <p th:case="*">中性</p> </td>