您的位置:首页 > 移动开发

Type handler was null on parameter mapping for property '__frch_productId_0'. It was either not spec

2017-07-21 17:00 656 查看
出现如上错误,原因: 在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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐