EL表达式的判断
来源:互联网 发布:巨人网络估值 编辑:程序博客网 时间:2024/05/27 03:25
el的判断
el的判断
- <!-- currentRoleId是存在request域中的、sysAdmin是存在application域中的,即servletContext中 -->
- <c:if test="${empty currentRoleId}">
- currentRoleId为空
- </c:if>
- <c:if test="${not empty currentRoleId}">
- currentRoleId不为空
- </c:if>
- <!-- 判断两者是否相等 -->
- <c:if test="${requestScope.currentRoleId eq applicationScope.sysAdmin}">
- currentRoleId和sysAdmin相等
- </c:if>
- <!-- 在这里就不是和empty一样了,在这里el表达式不相等不像判断是否为空那样,不为空是not empty,在这里不相等不是not eq,表示不相等应如下所示的取反操作 -->
- <c:if test="${!(requestScope.currentRoleId eq applicationScope.sysAdmin)}">
- currentRoleId和sysAdmin不相等
- </c:if>
- <!-- 不使用jstl判断,使用三目表达式输出 -->
- ${!(requestScope.currentRoleId eq applicationScope.sysAdmin) ? "两者不相等" : "两者相等"}
- ${not empty currentRoleId ? "不为空" : "为空"}
- <!-- currentRoleId是存在request域中的、sysAdmin是存在application域中的,即servletContext中 -->
- <c:if test="${empty currentRoleId}">
- currentRoleId为空
- </c:if>
- <c:if test="${not empty currentRoleId}">
- currentRoleId不为空
- </c:if>
- <!-- 判断两者是否相等 -->
- <c:if test="${requestScope.currentRoleId eq applicationScope.sysAdmin}">
- currentRoleId和sysAdmin相等
- </c:if>
- <!-- 在这里就不是和empty一样了,在这里el表达式不相等不像判断是否为空那样,不为空是not empty,在这里不相等不是not eq,表示不相等应如下所示的取反操作 -->
- <c:if test="${!(requestScope.currentRoleId eq applicationScope.sysAdmin)}">
- currentRoleId和sysAdmin不相等
- </c:if>
- <!-- 不使用jstl判断,使用三目表达式输出 -->
- ${!(requestScope.currentRoleId eq applicationScope.sysAdmin) ? "两者不相等" : "两者相等"}
- ${not empty currentRoleId ? "不为空" : "为空"}
el的判断
- <!-- currentRoleId是存在request域中的、sysAdmin是存在application域中的,即servletContext中 -->
- <c:if test="${empty currentRoleId}">
- currentRoleId为空
- </c:if>
- <c:if test="${not empty currentRoleId}">
- currentRoleId不为空
- </c:if>
- <!-- 判断两者是否相等 -->
- <c:if test="${requestScope.currentRoleId eq applicationScope.sysAdmin}">
- currentRoleId和sysAdmin相等
- </c:if>
- <!-- 在这里就不是和empty一样了,在这里el表达式不相等不像判断是否为空那样,不为空是not empty,在这里不相等不是not eq,表示不相等应如下所示的取反操作 -->
- <c:if test="${!(requestScope.currentRoleId eq applicationScope.sysAdmin)}">
- currentRoleId和sysAdmin不相等
- </c:if>
- <!-- 不使用jstl判断,使用三目表达式输出 -->
- ${!(requestScope.currentRoleId eq applicationScope.sysAdmin) ? "两者不相等" : "两者相等"}
- ${not empty currentRoleId ? "不为空" : "为空"}
- <!-- currentRoleId是存在request域中的、sysAdmin是存在application域中的,即servletContext中 -->
- <c:if test="${empty currentRoleId}">
- currentRoleId为空
- </c:if>
- <c:if test="${not empty currentRoleId}">
- currentRoleId不为空
- </c:if>
- <!-- 判断两者是否相等 -->
- <c:if test="${requestScope.currentRoleId eq applicationScope.sysAdmin}">
- currentRoleId和sysAdmin相等
- </c:if>
- <!-- 在这里就不是和empty一样了,在这里el表达式不相等不像判断是否为空那样,不为空是not empty,在这里不相等不是not eq,表示不相等应如下所示的取反操作 -->
- <c:if test="${!(requestScope.currentRoleId eq applicationScope.sysAdmin)}">
- currentRoleId和sysAdmin不相等
- </c:if>
- <!-- 不使用jstl判断,使用三目表达式输出 -->
- ${!(requestScope.currentRoleId eq applicationScope.sysAdmin) ? "两者不相等" : "两者相等"}
- ${not empty currentRoleId ? "不为空" : "为空"}
示例:
Spring MVC服务器端:
String roleName = adminRoleService.getRoleNameByAdminId(administer.getId().longValue());
String customerMan = "客户经理";
String customerMan = "客户经理";
model.addAttribute("roleName",roleName);
model.addAttribute("customerMan",customerMan);
model.addAttribute("customerMan",customerMan);
jsp页面客户端:
<c:if test="${(roleName eq customerMan)}">
<th width="88" scope="col">审 核</th>
</c:if>
<th width="88" scope="col">审 核</th>
</c:if>
0 0
- el表达式的判断
- EL表达式的判断
- EL表达式的判断
- el表达式的判断
- EL表达式的判断
- EL判断语句的表达式
- el表达式null和空的判断
- EL表达式中的empty判断的结果
- EL表达式:字符串为空的判断
- EL表达式常用判断
- EL 表达式判断
- el 表达式判断
- EL表达式使用判断
- El el表达式,判断是否为空
- El el表达式,判断是否为空
- el ${}表达式判断空值
- EL表达式遍历时间和判断list的大小
- js中el表达式的使用和非空判断
- 第七节 linux c的基本应用
- 【面试题】-反转句子
- [Phonegap+Sencha Touch] 移动开发5、Sencha touch结合Phonegap使用
- SSH:java.lang.ClassNotFoundException
- hdu1027Ignatius and the Princess II <vector>
- EL表达式的判断
- 第八节linux文件系统
- [文摘] Zend Guard 5.5版本破解方式和加密后永不过期的操作方法
- CENTOS 6.5 配置YUM安装NGINX
- 关于程序员面试宝典书上一道删除单链表头元素的函数的题小结
- phpcms 动态调用 图片
- 第九节 标准输入输出
- 什么是姿态角(Euler角)pitch yaw roll
- 各种退出应用程序