1.思路
接受前端的表单,将数据存入数据库。
2.代码:
controller:
/* * 添加员工信息 * */ @RequestMapping("add") public String addEmployee(Employee employee){ log.debug("员工名称:{}",employee.getName()); log.debug("员工工资:{}",employee.getSalary()); log.debug("员工生日:{}",employee.getBirthday()); log.debug("员工性别:{}",employee.getGender()); //1.保存员工信息 employeeService.add(employee); return "redirect:/employee/list"; }
service:(实现)
@Override public void add(Employee employee) { employeeDao.add(employee); }
效果:
标签:log,员工,debug,add,添加,jsp,ems,employee From: https://www.cnblogs.com/sxwgzx23/p/18054973