@RequestMapping( value = "/project", params = {"id"}, method = RequestMethod.GET) public @ResponseBody Project getProject(HttpServletRequest req) { final Long rowId = Long.valueOf(req.getParameter("id")); Project editedProject = projectService.findProject(rowId); return editedProject; }
@RequestMapping(value = "/project", method = RequestMethod.POST) public String saveProject(Project project, BindingResult bindingResult) { projectService.saveProject(project); return "redirect:project"; }
@RequestMapping(value = "/project", method = RequestMethod.GET) public String getProjects(Model model) { model.addAttribute("projects", projectService.getProjects()); return "project"; }