C标签的使用.md

  • <c:set> 设置变量
    • <c:set var="a" scope="request" value="${'www'}"/>
    • var 变量名称
    • scope 作用域(Page,Request,Session,Application)
    • value 值
  • <c:out> 输出
    • <c:out value="${a}" default=""></c:out>
    • value 值
    • default 默认值
  • <c:if> 判断
    • <c:if test="${salary > 2000}">
    • test 条件
  • <c:forEach> 循环
    <c:forEach items="${list}" var="u">
        <c:out value="${u.name}"/>
    </c:forEach>
    
  • switch
    <c:choose>
        <c:when test="${salary <= 0}">
           太惨了。
        </c:when>
        <c:when test="${salary > 1000}">
           不错的薪水,还能生活。
        </c:when>
        <c:otherwise>
            什么都没有。
        </c:otherwise>
    </c:choose>
    
原文地址:https://www.cnblogs.com/tonghaolang/p/7600178.html