首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

<c:if test>标签运用

2012-11-25 
c:if test标签使用1test命令之数字test语法:[ number relation number ] 通过关系运算符来对数字进行比

<c:if test>标签使用
1>test命令之数字test
语法:
[ number relation number ] 通过关系运算符来对数字进行比较
关系运算符:
-lt    小于
-le     小于或者等于
-gt    大于
-ge    大于或者等于
-eq    等于
-ne    不等于

//count>1<c:if test="${count eq 1}">(equals)等于1</c:if>//count!=1<c:if test="${count ne 1}">(equals)不等于1</c:if>//count>=2<c:if test="${count ge 2}">(gt eq)大于等于2<c:if>//count<2<c:if test="${count le 2}">(lt eq小于等于2<c:if>//count>1<c:if test="${count gt 1}">(gt)大于1<c:if>//count<1<c:if test="${count lt 1}">(lt)大于1<c:if>

2>输出
   <c:if test="${param.username = = 'admin' }">  ADMIN您好!! //body部分  </c:if>

3>判空
<c:if test="${empty count }"></c:if>

热点排行