示例#1
0
 @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;
 }
示例#2
0
 @RequestMapping(value = "/project", method = RequestMethod.POST)
 public String saveProject(Project project, BindingResult bindingResult) {
   projectService.saveProject(project);
   return "redirect:project";
 }
示例#3
0
 @RequestMapping(value = "/project", method = RequestMethod.GET)
 public String getProjects(Model model) {
   model.addAttribute("projects", projectService.getProjects());
   return "project";
 }