EL表达式:字符串为空的判断

来源:互联网 发布:淘宝推广文案怎么写 编辑:程序博客网 时间:2024/05/18 00:09

EL表达式判断字符串为空(条件连接时用and &&、or ||、not ! ):


几种情况如下:

String username..  --->  ${empty username}..
  =null                     true
  =""                       true

String username..  --->  ${username==''}..
  =null                     false
  =""                       true

String username..  --->  ${username==null}..
  =null                     true
  =""                       false

String username..  --->  ${username=='null'}..
  =null                     false
  =""                       false