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. -->
  • 相关阅读:
    高精度乘法
    阶乘
    高精度减法
    高精度加法
    曹冲养猪
    采药2
    nginx.conf详解
    系统盘脚本扩容
    IDEA中编写脚本并运行shell脚本
    常用的pdf工具
  • 原文地址:https://www.cnblogs.com/doit8791/p/4787742.html
Copyright © 2011-2022 走看看