c:if选择标签
来源:互联网 发布:矩阵的幂运算法则 编辑:程序博客网 时间:2024/05/28 11:30
1.jstl c 标签实现判断功能
单个判断:
<c:if test="${resource.value=='GALL' && resource.checked == true}">
context here!
</c:if>
多重判断:
<c:choose>
<c:when test="${resource.value=='GALL' && resource.checked == true}">
Your context here!
</c:when>
<c:otherwise>Your context here!</c:otherwise>
</c:choose>
<c:otherwise>
在同一个 <c:choose> 中,当所有 <c:when> 的条件都没有成立时,则执行 <c:otherwise> 的本体内容。
语法 <c:otherwise> 本体内容 </c:otherwise> 属性 无 限制 ·<c:otherwise> 必须在 <c:choose> 和 </c:choose>之间 ·在同一个 <c:choose> 中时,<c:otherwise> 必须为最后一个标签 说明 在同一个 <c:choose> 中,假若所有 <c:when> 的test属性都不为true时,则执行 <c:otherwise> 的本体内容。 范例 笔者举一个典型的 <c:choose>、<c:when>和<c:otherwise>范例: <c:choose> <c:when test="${condition1}"> condition1为true </c:when> <c:when test="${ condition2}"> condition2为true </c:when> <c:otherwise> condition1和condition2都为false </c:otherwise> </c:choose> 范例说明:当condition1为true时,会显示“condition1为true”;当condition1为false且condition2为true时,会显示“condition2为true”,如果两者都为false,则会显示“condition1和condition2都为false”。 注意 假若condition1和condition2两者都为true时,此时只会显示"condition1为true",这是因为在同一个<c:choose>下,当有好几个<c:when>都符合条件时,只能有一个<c:when>成立。阅读全文
0 0
- c:if选择标签
- c:if标签
- 开发<c:if>标签
- <c:if>标签
- c:if标签用法
- c:if标签
- c:if标签
- c标签 if else
- <c:if>标签使用
- <c:if> <c:choose> 标签
- c标签 if else c标签 总结
- c标签 if else c标签 总结
- c标签 if else c标签 总结
- c标签 if else c标签 总结
- c标签 if else c标签 总结
- c标签 if else c标签 总结
- c标签 if else c标签 总结
- c标签 if else c标签 总结
- Hololens开发 初级系列 -3 HoloWorld
- Stars(树状数组)
- Spring中@Autowired注解、@Resource注解的区别
- java判断URL协议自动补全HTTP(S)
- View学习(一)--坐标系
- c:if选择标签
- spring3.X MVC 在tomcat6和tomcat7加载静态资源的不同
- 单机多实例数据库搭建过程
- 我的自述——人生与程序
- XML的解析
- BZOJ[3728]PA2014 Final Zarowki 堆+贪心
- 1029. 旧键盘(20)
- Hadoop读写过程的源码分析
- 记休产假前的一些杂想