zoukankan      html  css  js  c++  java
  • 开发jsp中常用标签

    s标签:
    <%@ taglib prefix="s" uri="/struts-tags"%>
    request中取值:<s:property value="#request.tipMessage"/>
    request中取集合长度:<s:property value="#request.list.size()"/>
    request中判断:
            <s:if test="#request.list.size() != 0">
                 if成立了!!!
            </s:if>
            <s:else>
                if后边可以跟else,也可以再跟elseif
            </s:else>
    迭代:
            <s:iterator id="li" value="#request.list" status="st">
                <s:property value="#li.fullName"/>
                  <s:property value="#li.level"/>
                <s:if test="#li.userType=='02' || #li.userType=='03'">
                      <s:property value="#li.agentProvinceName"/>
                  </s:if>
            </s:iterator>
    c标签:
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>
    request中取值:    request.setAttribute("name", "zhuang");  
                    ${name}
    request中取对象:request.setAttribute("person", person);   
                    ${person.age}
    判断:<c:if test="${empty biaoji || biaoji=='01' }">
            满足标记为空或者是01
          </c:if>
    遍历:
         <c:forEach items="${list}" var="message" varStatus="index" >
            <tr>
                <td><c:if test="${message.type=='01' }">系统消息</c:if></td>
                <td>${message.content}</td>
                <td>
                    <c:choose>
                        <c:when test="${message.isRead=='01' }">未读</c:when>  
                        <c:otherwise>已读</c:otherwise>
                    </c:choose>  
                </td>
                <td>${message.createTime}</td>
            </tr>
        </c:forEach>

  • 相关阅读:
    在 LR 中如何解决Socket 接收数据的验证
    UE 的文件比较方法
    使用plSQL连接Oracle报错,SQL*Net not properly installed和TNS:无法解析指定的连接标识符
    plsql developer连接oracle数据库
    将列表中的字符以‘*’连接生成一个新的字符串
    ElasticSearch之CURL操作
    MySQL 5.7.21 免安装版配置教程
    C# IL DASM 使用-破解c#软件方法
    For-each Loop,Index++ Loop , Iterator 那个效率更高
    10种简单的Java性能优化
  • 原文地址:https://www.cnblogs.com/zhuangwf/p/5452691.html
Copyright © 2011-2022 走看看