@RequestMapping(value = URL_PROFILE_ADDLANGUAGE, method = RequestMethod.POST) public ModelAndView addLanguage( @ModelAttribute(COMMAND_LANGUAGE) @Valid LanguageSkill addWorkExperience, BindingResult result, Locale locale) { if (result.hasErrors()) { // basic validation fails ModelAndView modelAndView = constructModelAndView(addWorkExperience, locale); modelAndView.addObject(COMMAND_LANGUAGE, addWorkExperience); return modelAndView; } profileService.storeLanguageSkill(addWorkExperience); ModelAndView modelAndView = new ModelAndView(new RedirectView(URL_ACCOUNT_VITEA)); return modelAndView; }
@RequestMapping(value = "/profile/language/{language}", method = RequestMethod.POST) public ModelAndView editLanguage( @ModelAttribute(COMMAND_LANGUAGE) @Valid LanguageSkill languageSkill, BindingResult result, Locale locale) { if (result.hasErrors()) { // basic validation fails ModelAndView modelAndView = constructModelAndView(languageSkill, locale); modelAndView.addObject(COMMAND_LANGUAGE, languageSkill); return modelAndView; } profileService.storeLanguageSkill(languageSkill); ModelAndView modelAndView = new ModelAndView(new RedirectView(URL_ACCOUNT_VITEA)); return modelAndView; }