首页 > 技术文章 > SSM日志

--lr 2019-06-28 15:53 原文

2019/6/26

实现简单闭环的增加保安信息功能,mapper.xml文件只能放到resource文件夹下才能被自动扫描到

2019/6/27

实现简单闭环的查询所有保安信息功能,当实体类中的属性名和数据库中的列名不一致时,设置结果类型

1 <resultMap id="securityMap" type="edu.qut.pojo.SecurityStaff">
2    <id property="SecurityStaffId" column="idsecuritystaff"></id>
3    <result property="SecurityStaffAge" column="agesecuritystaff"></result>
4    <result property="SecurityStaffName" column="namesecuritystaff"></result>
5 </resultMap>

将结果集映射到实体类对象中
ModelAndView按照键值对的方式存储数据
1 ModelAndView view = new ModelAndView("SecurityStaffList");
2 view.addObject("SecurityStaffList",securityStaffList);
在前台JSP页面中要用键值取出数据

2019/6/28

实现简单闭环中的根据保安编号删除一条安保信息的功能,当Controller类中方法传递的是一个实体类的时候,前台JSP页面必须对类中每一个属性赋值,否则就会出现错误

The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

实现简单闭环中的根据保安编号更新保安信息的功能

推荐阅读