EL表达式的判断

el的判断
Html代码  复制代码  收藏代码
  1.  
  2. <c:if test="${empty currentRoleId}"> 
  3.      currentRoleId为空 
  4. c:if> 
  5. <c:if test="${not empty currentRoleId}"> 
  6.      currentRoleId不为空 
  7. c:if> 
  8.  
  9.  
  10. <c:if test="${requestScope.currentRoleId eq applicationScope.sysAdmin}"> 
  11.      currentRoleId和sysAdmin相等 
  12. c:if> 
  13.  
  14.  
  15. <c:if test="${!(requestScope.currentRoleId eq applicationScope.sysAdmin)}"> 
  16.      currentRoleId和sysAdmin不相等 
  17. c:if> 
  18.  
  19.  
  20.  
  21. ${!(requestScope.currentRoleId eq applicationScope.sysAdmin) ? "两者不相等" : "两者相等"} 
  22.  
  23. ${not empty currentRoleId ? "不为空" : "为空"} 
[html]  view plain  copy
 print ?
  1.   
  2. <c:if test="${empty currentRoleId}">  
  3.      currentRoleId为空  
  4. c:if>  
  5. <c:if test="${not empty currentRoleId}">  
  6.      currentRoleId不为空  
  7. c:if>  
  8.   
  9.   
  10. <c:if test="${requestScope.currentRoleId eq applicationScope.sysAdmin}">  
  11.      currentRoleId和sysAdmin相等  
  12. c:if>  
  13.   
  14.   
  15. <c:if test="${!(requestScope.currentRoleId eq applicationScope.sysAdmin)}">  
  16.      currentRoleId和sysAdmin不相等  
  17. c:if>  
  18.   
  19.   
  20.   
  21. ${!(requestScope.currentRoleId eq applicationScope.sysAdmin) ? "两者不相等" : "两者相等"}  
  22.   
  23. ${not empty currentRoleId ? "不为空" : "为空"}  

el的判断
Html代码  复制代码  收藏代码
  1.  
  2. <c:if test="${empty currentRoleId}"> 
  3.      currentRoleId为空 
  4. c:if> 
  5. <c:if test="${not empty currentRoleId}"> 
  6.      currentRoleId不为空 
  7. c:if> 
  8.  
  9.  
  10. <c:if test="${requestScope.currentRoleId eq applicationScope.sysAdmin}"> 
  11.      currentRoleId和sysAdmin相等 
  12. c:if> 
  13.  
  14.  
  15. <c:if test="${!(requestScope.currentRoleId eq applicationScope.sysAdmin)}"> 
  16.      currentRoleId和sysAdmin不相等 
  17. c:if> 
  18.  
  19.  
  20.  
  21. ${!(requestScope.currentRoleId eq applicationScope.sysAdmin) ? "两者不相等" : "两者相等"} 
  22.  
  23. ${not empty currentRoleId ? "不为空" : "为空"} 
[html]  view plain  copy
 print ?
  1.   
  2. <c:if test="${empty currentRoleId}">  
  3.      currentRoleId为空  
  4. c:if>  
  5. <c:if test="${not empty currentRoleId}">  
  6.      currentRoleId不为空  
  7. c:if>  
  8.   
  9.   
  10. <c:if test="${requestScope.currentRoleId eq applicationScope.sysAdmin}">  
  11.      currentRoleId和sysAdmin相等  
  12. c:if>  
  13.   
  14.   
  15. <c:if test="${!(requestScope.currentRoleId eq applicationScope.sysAdmin)}">  
  16.      currentRoleId和sysAdmin不相等  
  17. c:if>  
  18.   
  19.   
  20.   
  21. ${!(requestScope.currentRoleId eq applicationScope.sysAdmin) ? "两者不相等" : "两者相等"}  
  22.   
  23. ${not empty currentRoleId ? "不为空" : "为空"}  

你可能感兴趣的:(Servlet)