Caused by: org.apache.ibatis.ognl.ParseException: Encountered ""——MyBatis

Caused by: org.apache.ibatis.ognl.ParseException: Encountered “”——MyBatis


使用MyBatis时遇到一个问题,其核心错误信息如下:

Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression ''. Cause: org.apache.ibatis.ognl.ExpressionSyntaxException: Malformed OGNL expression:  [org.apache.ibatis.ognl.ParseException: Encountered "" at line 1, column 0.
Was expecting one of:
    ":" ...
    "not" ...
    "+" ...
    "-" ...
    "~" ...
    "!" ...
    "(" ...
    "true" ...
    "false" ...
    "null" ...
    "#this" ...
    "#root" ...
    "#" ...
    "[" ...
    "{" ...
    "@" ...
    "new" ...
     ...
     ...
    "\'" ...
    "`" ...
    "\"" ...
     ...
     ...
    ]
Caused by: org.apache.ibatis.ognl.ParseException: Encountered "" at line 1, column 0.
Was expecting one of:
    ":" ...
    "not" ...
    "+" ...
    "-" ...
    "~" ...
    "!" ...
    "(" ...
    "true" ...
    "false" ...
    "null" ...
    "#this" ...
    "#root" ...
    "#" ...
    "[" ...
    "{" ...
    "@" ...
    "new" ...
     ...
     ...
    "\'" ...
    "`" ...
    "\"" ...
     ...
     ...

经过多番查找,发现问题出现在了select代码中得if判断码上,正常的if判断语句应是:


			and t1.GENDER = #{param.gender}

param:是存放查询条件的参数的集合;


pass:多细心,多努力!

《END》

你可能感兴趣的:(Mybatis)