@RequestMapping(value = "/edit", method = RequestMethod.POST) public String edit(@ModelAttribute User user) { System.out.println("user = "******"redirect:/"; }
@RequestMapping(value = "/list", method = RequestMethod.GET) public String list( Model model, @RequestParam(required = false) String name, @RequestParam(required = false) String email, @RequestParam(required = false) String order) { Searchable searchable = new Searchable(); searchable.setName(name); searchable.setEmail(email); searchable.setOrderParam(order); model.addAttribute("users", userMapper.findByProvider(searchable)); // model.addAttribute("users", userMapper.findByScript(searchable)); return "list"; }
@RequestMapping(value = "/edit", method = RequestMethod.GET) public String edit(@RequestParam int id, Model model) { model.addAttribute("user", userMapper.findOne(id)); return "edit"; }