Tag Archives: malform

[mybatis] error: malformed ognl expression: name! = null and name! = ‘”

1、 Questions

Malformed ognl expression: name! = null and name! = ‘
report an error;
malformed means abnormal;

2、 Solutions and reasons

It turned out to be* Mapper.xml In the document:

<if test ="userId ! null">

The equals sign is missing; the SQL in the automatically generated mybatis file is missing an equals sign

<if test ="userId != null">

Moreover, there should be no space between exclamation mark and equal sign;