@RequestMapping( value = Constants.CREATE_UPDATE_PRIORITY_CONTROLLER, method = {RequestMethod.GET, RequestMethod.POST}) public String createUpdatePriorityController( @RequestParam(Constants.KEY_PRIORITY_ID) int priorityId, Model model) { IPriorityDAO priorityDAO = PriorityDAOFactory.getClassFromFactory(); Priority priority = priorityDAO.getPriority(priorityId); model.addAttribute(Constants.KEY_PRIORITY, priority); priorityDAO.close(); return Constants.UPDATE_PRIORITY_PAGE; }
@RequestMapping( value = Constants.INSERT_UPDATE_PRIORITY_CONTROLLER, method = {RequestMethod.GET, RequestMethod.POST}) public String InsertUpdatePriorityController( @RequestParam(Constants.KEY_PRIORITY_ID) int priorityId, @RequestParam(Constants.KEY_NAME) String priorityName, Model model) { IPriorityDAO priorityDAO = PriorityDAOFactory.getClassFromFactory(); Priority priority = priorityDAO.getPriority(priorityId); priority.setName(priorityName); priorityDAO.updatePriority(priority); logger.info(INFO_UPDATE_PROJECT + " " + priorityName); model.addAttribute(Constants.KEY_PRIORITIES, priorityDAO.getListPriority()); priorityDAO.close(); return Constants.CREATE_PRIORITIES_LIST_PAGE_CONTROLLER; }