Exemplo n.º 1
0
  @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;
  }
Exemplo n.º 2
0
  @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;
  }