遇到俩问题:一个是mybatis生疏 在EmpMapper.xml中定义resultMap
<resultMap id="EmpWithDept" type="com.lwp.bean.Emp"> <id column="emp_id" property="empId"></id> <result column="emp_name" property="empName"></result> <result column="gender" property="gender"></result> <result column="email" property="email"></result> <result column="d_id" property="did"></result> <association property="dept" javaType="com.lwp.bean.Dept"> <id column="dept_id" property="deptId"></id> <result column="dept_name" property="deptName"></result> </association> </resultMap>
其中column是表的字段 property是实体类 的字段 我给记反了
第二个问题 查出集合放入前端index.html 用thymeleay接受发现
An error happened during template parsing (template: "class path resource [templates/list.html]
经检查发现modelandview传来的是个字符串而不是集合
原:===》mv.addObject("pageInfo","pageInfo");
检查===》mv.addObject("pageInfo",pageInfo);
ok
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。