title: HTTP Status 400 - Required Integer parameter 'idCandidate' is not present
body: <p>I have so methiods in my @Controller:</p>
  
  <p>skillList:</p>
  
  <pre><code>    @ModelAttribute(value = "skillsIdList")
          public Set&lt;Skill&gt; getSkillListById(@RequestParam(required = false) List&lt;Integer&gt; skills,@ModelAttribute("skills")List&lt;Skill&gt; allSkills ) {
              if (skills== null)
                  return null;
              Set&lt;Skill&gt; returnList = new  HashSet&lt;Skill&gt;();
              for(Integer skillId:skills){
                  for(Skill skill:allSkills){
                      if(skillId.equals(skill.getId())){
                          returnList.add(skill);
                          break;
                      }
                  }   
              }
              return returnList;
          }
  </code></pre>
  
  <p>candidate:</p>
  
  <pre><code>@ModelAttribute(value = "candidateFromRequest")
      public Candidate loadCandidateById(@RequestParam(required = false) Integer idCandidate) {
          if (idCandidate!= null)
              return candidateService.findById(idCandidate);
          return null;
      }
  </code></pre>
  
  <p>vacancies: </p>
  
  <pre><code>@ModelAttribute(value = "vacanciesForCandidate")
      public Set&lt;Vacancy&gt; vacanciesForCandidate(@RequestParam(required = false) List&lt;Integer&gt; vacanciesSelected,@ModelAttribute("vacancies")List&lt;Vacancy&gt; allVacancies ) {
          if (vacanciesSelected== null)
              return null;
          Set&lt;Vacancy&gt; returnList = new  HashSet&lt;Vacancy&gt;();
          for(Integer vacancyId:vacanciesSelected){
              for(Vacancy vacancy:allVacancies){
                  if(vacancyId.equals(vacancy.getId())){
                      returnList.add(vacancy);
                      break;
                  }
              }   
          }
          return returnList;
      }
  </code></pre>
  
  <p>it works</p>
  
  <pre><code>@RequestMapping("/saveCandidate")
      public String saveCandidate(Model model,HttpServletRequest request,HttpResponse response
              ,@ModelAttribute("candidateFromRequest") Candidate candidateFromRequest
              ,@ModelAttribute("skillsIdList") Set&lt;Skill&gt; skills
             ,@ModelAttribute("vacanciesForCandidate") Set&lt;Vacancy&gt; vacanciesForCandidate
              )
      {
          candidateFromRequest.setSkills(skills);
          candidateFromRequest.setVacancies(vacanciesForCandidate);
          candidateService.update(candidateFromRequest);
          return "candidateMenu";
      }
  </code></pre>
  
  <p>But it doesn't work(HTTP Status 400 - Required Integer parameter 'idCandidate' is not present):</p>
  
  <pre><code>@RequestMapping("/addCandidate")
      public String addCandidate(Model model,HttpServletRequest request,HttpResponse response
              ,@ModelAttribute Candidate myCandidate
              ,@ModelAttribute("skillsIdList") Set&lt;Skill&gt; skills
             ,@ModelAttribute("vacanciesForCandidate") Set&lt;Vacancy&gt; vacanciesForCandidate)
      {
          myCandidate.setSkills(skills);
          myCandidate.setVacancies(vacanciesForCandidate);
          candidateService.add(myCandidate);
          return "candidateMenu";
      }
  </code></pre>
  
  <p>I don't inderstand the cause of this message because I write <code>@RequestParam(required = false) Integer idCandidate</code></p>