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

时间:2021-12-25 06:11:43

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