for循环list、取得索引值、定义变量、取出map中的value、if...else循环、日期

浪尽此生 提交于 2019-12-05 21:19:37

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

1、for循环list、取得索引值、定义变量、取出map中的value、if...else循环、日期格式化、空值判断、字符串函数

<c:forEach items="${tableNameVoList}" var="tableNameVar" varStatus="i" >
  <c:set var="tableNameTemp" value="${ tableNameVar.tableName }" scope="request" />
    
  <!-- 判断是否展示表 -->
  <c:choose>
    <c:when test="${tableViewFlag[tableNameTemp] == true}">
     <li><a href="#page_${i.index}" id="${i.index}">${tableNameVar.tableNameZh}</a></li>
    </c:when>
    <c:otherwise>
     ${columnValue}****
    </c:otherwise>
  </c:choose>
</c:forEach>


<fmt:formatDate value="${columnValue}" pattern="yyyy-MM-dd"/></td>

<fmt:formatDate value="${columnValue}" pattern="yyyy-MM-dd HH:dd:ss"/></td>

<c:when test="${!empty columnValue && fn:length(columnValue) > 4}"> 
 <c:set var="strTemp" value="${fn:substring(columnValue, 0, fn:length(columnValue)-4)}" />
 ${strTemp}****
</c:when>

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!