显示信息

@RequestMapping("/emps")//转换的地址
public String list(Model model)
{
Collection<Employee> getallee = employeeDao.getallee();
model.addAttribute("getAllEmployee",getallee);//存在model中然后从页面中提取
return "list";
}


<thead>
<tr>
<th>id</th>
<th>lastname</th>
<th>email</th>
<th>gander</th>
<th>department</th>

</tr>
</thead>
<tbody>
<!--/*@thymesVar id="emps" type="com"*/-->
<tr th:each="emp:${getAllEmployee}">
<!--/*@thymesVar id="getId" type="com"*/-->
<td th:text="${emp.getId()}"></td>
<td th:text="${emp.getLastName()}"></td>
<td th:text="${emp.getEmail()}"></td>
<td th:text="${emp.getGender()==0?'女':'男'}"></td>
<td th:text="${emp.getDepartment().getDepartmentName()}"></td>
<td>
<button>编辑</button>
<button>删除</button>
</td>
</tr>
</tbody>
posted @ 2022-01-18 20:57  爽爽子的秃头生活  阅读(41)  评论(0)    收藏  举报