出现如上错误,原因: 在mybatis使用<foreach>标签的时候 , collection 为传入的List item为里面的对象,如果直接对item取值就会出现如此错误。
解决:对item进行取值
------------------------------------------------------
bean : student{id ,name,gender,score}
dao: public List<student> getStudentList( List<student> param); 注: 这里通过student 的id来查询学生信息
XML:<foreach collection="param" index="index" item="l" open="("
separator="OR" close=")">
id= #{id} 错误写法
id=#{l.id} 正确写法
</foreach>