分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 前端开发

jstl 遍历数据

发布时间:2023-09-06 01:59责任编辑:沈小雨关键词:js遍历

1   导入 jstl  的  jar 包

2. 页面中添加

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

3.   使用 jstl 遍历  employeeList  后端传过来的是一个 集合,   当动存放的是 对象

<c:if test="${empty requestScope.employeeList }"> ???????没有任何员工信息 ???</c:if> ???<c:if test="${!empty requestScope.employeeList }"> ???????<table border="1" cellpadding="10" cellspacing="0"> ???????????<tr> ???????????????<th>ID</th> ???????????????<th>LastName</th> ???????????????<th>Email</th> ???????????????<th>Gender</th> ???????????????<th>Department</th> ???????????????<th>Edit</th> ???????????????<th>Delete</th> ???????????</tr> ???????????<c:forEach items="${requestScope.employeeList }" var="emp"> ???????????????<tr> ???????????????????<td>${emp.id }</td> ???????????????????<td>${emp.lastName }</td> ???????????????????<td>${emp.email }</td> ???????????????????<td>${emp.gender == 0 ? ‘Female‘ : ‘Male‘ }</td> ???????????????????<td>${emp.department.departmentName }</td> ???????????????????<td><a href="">Edit</a></td> ???????????????????<td><a class="delete" href="emp/${emp.id }">Delete</a></td> ???????????????</tr> ???????????</c:forEach> ???????</table> ???</c:if>

jstl 遍历数据

原文地址:https://www.cnblogs.com/redhat0019/p/9183426.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved