• 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. -->
  • 相关阅读:
    阿里十八罗汉、腾讯五虎将、百度七剑客……大佬们是如何找到创始合伙人的?
    子元素margin-top后,跟父元素一起下沉
    css 学习网址
    文字折行不折行 css
    js typeof
    position_css
    springmvc initial初始化
    android MD5 SHA1
    hibernate 三种状态
    Springmvc Exception
  • 原文地址:https://www.cnblogs.com/doit8791/p/4787742.html
Copyright © 2020-2023  润新知