zoukankan      html  css  js  c++  java
  • 【转】<c>标签相关知识

    <c:choose>、<c:when> ||<c:otherwise>
    <c:choose> 和 <c:when> 、 <c:otherwise> 一起实现互斥条件执行,类似于 Java 中的 if else.
    <c:choose> 一般作为 <c:when> 、 <c:otherwise> 的父标签。
    eg :
    <c:choose>
           <c:when test="${row.v_money<10000}">
                  初学下海

           </c:when>

           <c:when test="${row.v_money>=10000&&row.v_money<20000}">
                  身手小试

           </c:when>

           <c:otherwise>
                  商业能手

           </c:otherwise>

    </c:choose>

    ------------eq(==),ne(!=),le(<=),ge(>=),lt(<),gt(>);--------------------------

      我们常会用c标签来遍历需要的数据,为了方便使用,varStatus属性可以方便我们实现一些与行数相关的功能,如:奇数行、偶数行差异;最后一行特殊处理等等。先就varStatus属性常用参数总结下:

    ${status.index}      输出行号,从0开始。
    ${status.count}      输出行号,从1开始。
    ${status.current}   当前这次迭代的(集合中的)项
    ${status.first}  判断当前项是否为集合中的第一项,返回值为true或false
    ${status.last}   判断当前项是否为集合中的最后一项,返回值为true或false
    begin、end、step分别表示:起始序号,结束序号,跳跃步伐。
     
    如:<c:forEach begin='1' end='5' step='2' items='${list}' var='item'>
    表示:操作list集合汇中1~5条数据,不是逐条循环,而是按每2个取值。即操作集合中的第1、3、5条数据。
  • 相关阅读:
    mysql The server time zone value 'xxx' is unrecognized
    mysql Public Key Retrieval is not allowed
    mysql Unable to load authentication plugin 'caching_sha2_password'.
    ZOJ Problem Set
    ZOJ Problem Set
    ZOJ Problem Set
    ZOJ Problem Set
    ZOJ Problem Set
    ZOJ Problem Set
    ZOJ Problem Set
  • 原文地址:https://www.cnblogs.com/flord/p/5740966.html
Copyright © 2011-2022 走看看