zoukankan      html  css  js  c++  java
  • 2015第37周一struts2 jstl 标签

    复制代码
    <c:if test="${user.password == 'hello'}">     
    <c:choose>         
    <c:when test="${user.age <= 18}">             
    <font color="blue"/>         
    </c:when>         
    <c:when test="${user.age <= 30 && user.age > 18}">             
    <font color="red"/>         
    </c:when>         
    <c:otherwise>             
    <font color="green"/>         
    </c:otherwise>     
    </c:choose>
    </c:if>
    复制代码

    STRUTS2:

    复制代码
    <s:if test="#user.age <= 18">     
    <font color="blue"/>
    </s:if>
    <s:elseif test="#user.age <= 30 && user.age > 18">     
    <font color="red"/>
    </s:elseif> 
    <s:else>    
    <font color="green"/>
    </s:else>
    复制代码

    6. 迭代标签

    JSTL:   

    复制代码
    <c:forEach var="user" items="${users}">     
    <c:out value="${user.userName}"/>
    </c:forEach><!-- 迭代固定次数 -->
    <c:forEach var="i" begin="1" end="10" step="3">    
    <c:out value="${i}"/>
    </c:forEach><!-- 这种循环相当于for(int i=1; i<10; i++), 其中step是指迭代的步长,默认为1. -->
  • 相关阅读:
    Android View 阴影的总结
    清晰的教你如何将 Maven 项目上传至 中央仓库以及版本更新
    简单粗暴的上传项目至 Github
    App自动更新(DownloadManager下载器)
    类型判断
    前端防御XSS
    window.location.href/replace/reload()/页面跳转+替换+刷新
    对数组排序进行"洗牌"(随机排序)
    iframe跨域上传图片
    Vim 新手节省时间的小技巧
  • 原文地址:https://www.cnblogs.com/doit8791/p/4787742.html
Copyright © 2011-2022 走看看