JSTL 学习使用笔记

来源:互联网 发布:python sin函数 编辑:程序博客网 时间:2024/06/16 18:46
// 引入包<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

1、循环遍历 日期格式化 自增序号

<c:forEach items="${students}" var="student" varStatus="num">            <tr>                <td>${num.index+1}</td><!--此处使用索引值+1作为序号-->                <td>${student.jobNumber}</td>                <td>${student.name}</td>                    <!--格式化日期-->                    <fmt:formatDate value="${student.startTime}" type="date"/>                </td>           </tr></c:forEach>
原创粉丝点击