@RequestMapping(path = "addEmployee.do", method = RequestMethod.GET) public ModelAndView addEmployeeForm() { stateDAO.initStates(); ModelAndView mv = new ModelAndView(); mv.setViewName("add.jsp"); mv.addObject("states", stateDAO.getAbbrev()); mv.addObject(new Employee()); return mv; }
@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; }