<c:set> | 用于保存数据 |
<c:out> | 用于在JSP中显示数据,就像<%= ... > |
<c:set var="s" scope="request" value="123456"></c:set> <c:out value="${s}"></c:out> <c:set value="哈哈哈" var="db" scope="page"></c:set>
<c:if> | 与我们在一般程序中用的if一样 |
<c:if test="${db ne null}" var="z" scope="page"> <c:out value="${db}"></c:out> </c:if>
<c:if test="${user.username==''admin}"> 你好!!!</c:if>
<c:if test="${user.username eq ''admin}"> 你好!!!</c:if> //eq等于
<c:if test="${user.username ne ''admin}"> 你好!!!</c:if> //不等于
lt小于
le小于或者等于
gt大于
ge大于或者等于
<c:forEach> | 基础迭代标签,接受多种集合类型 |
此标签一般用于循环遍历数据库中的数据,遍历一般成表所以为table
<table> <tr> <th>采购编号</th> <th>采购类型</th> <th>采购商品名称</th> <th>采购单位</th> <th>采购数量</th> <th>采购人</th> <th>审批时间</th> <th>审批状态</th> <th>操作内容</th> </tr> <c:forEach items="${maps}" var="qq"> <tr> <td>${qq.pid}</td> <td>${qq.ptvpe}</td> <td>${qq.pname}</td> <td>${qq.punit}</td> <td>${qq.pnum}</td> <td>${qq.pperson}</td> <td>${qq.padate}</td> <td>${qq.pastate}</td> <td><a href="">审批</a></td> </tr> </c:forEach> </table>
<c:forTokens> | 根据指定的分隔符来分隔内容并迭代输出 |
<c:forTokens items="123|456|789" delims="|" var="t"> <c:out value="${t}"></c:out> </c:forTokens>