Beispiel #1
0
  @RequestMapping(method = RequestMethod.GET, value = "edit")
  public ModelAndView editPerson(@RequestParam(value = "id", required = false) Long id) {
    logger.debug("Received request to edit person id : " + id);
    ModelAndView mav = new ModelAndView();
    mav.setViewName("edit");
    Person person = null;
    if (id == null) {
      person = new Person();
    } else {
      person = personDao.find(id);
    }

    mav.addObject("person", person);
    return mav;
  }