版权声明:Hello,Bug https://blog.csdn.net/AdminPwd/article/details/89331645
今天在写SpringMvc中出现这个异常,异常如下:
Was expecting one of:
<EOF>
"," ...
"=" ...
"?" ...
"||" ...
"or" ...
"&&" ...
"and" ...
"|" ...
"bor" ...
"^" ...
"xor" ...
"&" ...
"band" ...
"==" ...
"eq" ...
"!=" ...
"neq" ...
"<" ...
"lt" ...
">" ...
"gt" ...
"<=" ...
"lte" ...
">=" ...
"gte" ...
"in" ...
"not" ...
"<<" ...
"shl" ...
">>" ...
"shr" ...
">>>" ...
"ushr" ...
"+" ...
"-" ...
"*" ...
"/" ...
"%" ...
"instanceof" ...
"." ...
"(" ...
"[" ...
<DYNAMIC_SUBSCRIPT> ...
]] with root cause
org.apache.ibatis.ognl.ParseException: Encountered " <IDENT> "HaCustom "" at line 1, column 26.
Was expecting one of:
<EOF>
"," ...
"=" ...
"?" ...
"||" ...
"or" ...
"&&" ...
"and" ...
"|" ...
"bor" ...
"^" ...
"xor" ...
"&" ...
"band" ...
"==" ...
"eq" ...
"!=" ...
"neq" ...
"<" ...
"lt" ...
">" ...
"gt" ...
"<=" ...
"lte" ...
">=" ...
"gte" ...
"in" ...
"not" ...
"<<" ...
"shl" ...
">>" ...
"shr" ...
">>>" ...
"ushr" ...
"+" ...
"-" ...
"*" ...
"/" ...
"%" ...
"instanceof" ...
"." ...
"(" ...
"[" ...
<DYNAMIC_SUBSCRIPT> ...
问题出在于*.xml中
问题解决,有可能xml中判断有中文
更重要的是你的判断语句中
//判断这里 注意看and并且and后面的字段
<if test="HaBillrecords.optType !=null and HaBillrecords.optType !=''">
AND POSITION('${HaBillrecords.optType}' in b.operation)>0
</if>
最后问题解决,总结要细心
如果有老鸟看出博文中写的错误,请赐教,如果问题没有解决,欢迎评论留言