@RequestMapping(“/UserMana”)
public String UserMana(Model model,HttpSession session,Page page) {
int total=UserMapper.getTotal();
page.caculateLast(total);
java.util.List
model.addAttribute(“cs”, cs);
session.getAttribute(“user2”);
session.setAttribute(“page”, page);
return “mana/UserMana/listUser”;
}
@RequestMapping("/addUser")
public String addUser(User User,HttpSession session) {
UserMapper.add(User);
//重定向是mappingURL再到具体页面 转发是具体页面
return "redirect:UserMana";
}
@RequestMapping("/deleteUser")
public String delUser(User User) {
UserMapper.delete(User.getId());;
//重定向是mappingURL再到具体页面 转发是具体页面
return "redirect:UserMana";
}
@RequestMapping("/editUser")
public String editUser(User User,HttpSession session) {
User c=UserMapper.get(User.getId());;
session.setAttribute("c", c);
return "mana/UserMana/editUser";
}
@RequestMapping("updateUser")
public String updateUser(User User){
UserMapper.update(User);
return "redirect:UserMana";
}
3300-1500=1800-1300=500