コード例 #1
0
  @RequestMapping(path = "updateEmployee.do", params = "id", method = RequestMethod.GET)
  public ModelAndView editEmployee(@RequestParam("id") int id) {
    Employee emp = dao.getEmployee(id);

    ModelAndView mv = new ModelAndView();
    mv.setViewName("updateEmployee.jsp");
    mv.addObject("employee", emp);
    mv.addObject("states", stateDAO.getAbbrev());
    return mv;
  }
コード例 #2
0
  @RequestMapping(path = "employee.do", params = "id", method = RequestMethod.GET)
  public ModelAndView displayEmployee(@RequestParam("id") int id) {
    Employee employee = dao.getEmployee(id);

    ModelAndView mv = new ModelAndView();
    mv.setViewName("employee.jsp");
    mv.addObject("employee", employee);

    return mv;
  }