@RequestMapping(value = "/list") public String list(Model model) { List<Part> parts = partManager.getAll(); model.addAttribute("aaa", parts); return "sales/master/part"; }
@RequestMapping(value = "/save") public String save(@Valid Part part, BindingResult result, Model model) { if (result.hasErrors()) { return "sales/master/partInput"; } partManager.save(part); return list(model); }
@RequestMapping(value = "/edit") public String edit(@RequestParam int id, Model model) { Part part = null; if (id == -1) { part = new Part(); } else part = partManager.get(id); model.addAttribute(part); return "sales/master/partInput"; }
@RequestMapping(value = "/delete") public String delete(@RequestParam int id, Model model) { partManager.remove(id); return list(model); }