@RequestMapping(value = "/create", method = RequestMethod.POST) public ModelAndView createEmployee( @RequestParam String name, @RequestParam int employeeId, @RequestParam String password) { if (!userService.getUserByName(name)) { Employee employee = employeeService.getEmployeeById(employeeId); User user = new User(name, EncryptionHelper.md5(password), employee); userService.createUser(user); } return new ModelAndView("redirect:/users/"); }