Mybatis XML出现OGNL的问题

org.apache.ibatis.ognl.ExpressionSyntaxException: Malformed OGNL expression: xxx is null || xxx == ''
[org.apache.ibatis.ognl.ParseException: Encountered " "xxx is null || xxx == ''" at line 1, column 1.
Was expecting one of:
 ":" ...
 "not" ...
 "+" ...
 "-" ...
 "~" ...
 "!" ...
 "(" ...
 "true" ...
 "false" ...
 "null" ...
 "#this" ...
 "#root" ...
 "#" ...
 "[" ...
 "{" ...
 "@" ...
 "new" ...
  ...
  ...
 "\'" ...
 "`" ...
 "\"" ...
  ...
  ...
 ]] with root cause
org.apache.ibatis.ognl.ParseException: Encountered ""xxx is null || xxx == ''" at line 1, column 1.
Was expecting one of:
 ":" ...
 "not" ...
 "+" ...
 "-" ...
 "~" ...
 "!" ...
 "(" ...
 "true" ...
 "false" ...
 "null" ...
 "#this" ...
 "#root" ...
 "#" ...
 "[" ...
 "{" ...
 "@" ...
 "new" ...
  ...
  ...
 "\'" ...
 "`" ...
 "\"" ...
  ...
  ...

mybatis出现OGNL的问题,原因是mybatis xml写法不满足OGNL要求,修改即可解决。
部分语法对照表:

bor(字符|)的英文         
xor      字符^的英文       
and      字符&&     
band    字符&       
eq     字符==      
neq    字符!=     
lt      字符<    
gt      字符>    
lte       字符<=   
 gte    字符>=    
shl    字符 <<    
shr    字符>>     
ushr    字符>>>

当然还有一种解决办法,在合适的地方加入 也可以。
栗子:

  

你可能感兴趣的:(Mybatis XML出现OGNL的问题)