title: many commandName for one form in Spring MVC
body: <p>I have a page jsp where i will use many attributes from differents POJO Classes so I need to use two commandName in the form.
  It's possible to user multiple @ModelAttribute in the controller so what's the point if multiple commandName is not working ?? </p>
  
  <p>For example I want to insert an information, name and function, name is an attribute in class Agent and function is an attribute in class Activity ? what should I do? </p>
  
  <h2>The controller</h2>
  
  <pre><code>@RequestMapping(value="/fiche_service",method=RequestMethod.GET)
      public ModelAndView Fiche_service(@ModelAttribute Activite activitey,@ModelAttribute Etablissement etabl,ModelMap model) {
          Agent ag = new Agent();
          return new ModelAndView("FicheService","agent",ag);
  
      }
  </code></pre>
  
  <h2>The form</h2>
  
  <pre><code>&lt;form:form
      action="${pageContext.request.contextPath}/ajouter_activite"
      method="post" commandName="activity" commandName="etabl"&gt;
  
    &lt;table id="tabmenu"&gt;
       &lt;tr&gt;
           &lt;td&gt;Fonction :&lt;/td&gt;
           &lt;td&gt;&lt;form:input type="text" class="round default-width-input" path="fonction"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
           &lt;td&gt;Nom d'établissement :&lt;/td&gt;
           &lt;td&gt;&lt;form:input type="text" class="round default-width-input" path="noml"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
           &lt;td&gt;Ville :&lt;/td&gt;
           &lt;td&gt;&lt;form:input type="text" class="round default-width-input" path="villel"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
           &lt;td&gt;Délégation :&lt;/td&gt;
           &lt;td&gt;&lt;form:input type="text" class="round default-width-input" path="cd_reg"&lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
           &lt;td&gt;Date début :&lt;/td&gt;
           &lt;td&gt;&lt;form:input type="text" name="date" class="tcal" value="" path="dateAffect"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
           &lt;td&gt;Date fin :&lt;/td&gt;
           &lt;td&gt;&lt;form:input type="text" name="date" class="tcal" value="" path="dateAffect_etab"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
           &lt;td&gt;&lt;input class="button round blue image-right ic-right-arrow"
                      type="submit" value="Créer" /&gt;&lt;/td&gt;
           &lt;td&gt;&lt;input class="button round blue image-right ic-right-arrow"
                      type="reset" value="Initialiser" /&gt;&lt;/td&gt;
       &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/form:form&gt;
  </code></pre>
  
  <p>The Exception:</p>
  
  <pre><code>Etat HTTP 500 - /WEB-INF/pages/FicheService.jsp (line: 397, column: 64) Attribute qualified names must be unique within an element
  </code></pre>
  
  <p>line 397 ==>    </p>
  
  <pre><code>method="post" commandName="activity" commandName="etabl"&gt;
  </code></pre>