title: JSP get/post with Spring MVC
body: <p>I'm trying to create a registration form. In this form there are some fields(username,password etc) and also a dropdown listbox. My problem is with this listbox.I manage to retrieve succesfully from a server all the items that will be added in the listbox and i want know to put it in this form.</p>
  
  <p>More specific i have a list called lista, which contains the items i want to add in the listbox.</p>
  
  <p>JSP:</p>
  
  <pre><code>&lt;c:url var="attinto" value="/reg" /&gt;
  &lt;form:form modelAttribute="attribute" method="POST" action="${attinto}"&gt;
  &lt;table&gt;
      .
              .
  
      &lt;tr&gt;
          &lt;td&gt;&lt;form:label path="researchareas"&gt;Research area:&lt;/form:label&gt;&lt;/td&gt;
          &lt;td&gt;    
            &lt;select multiple="multiple"&gt;   
              &lt;c:forEach items="${researchareas}" var="researcharea"&gt;     
                &lt;option value="${researcharea}"&gt;  ${researcharea} &lt;/option&gt;                   
              &lt;/c:forEach&gt;
            &lt;/select&gt;    
          &lt;/td&gt; 
      &lt;/tr&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>    @RequestMapping(value = "/reg", method = RequestMethod.GET)
      public String getform(Model model) {
  
          getAll(model);
          model.addAttribute("attribute", new Reg());
  
          return "reg";
      }
  </code></pre>
  
  <p>I have to mention at this point that the getAll(model) is a void method similar to the following:</p>
  
  <pre><code>      model.addAttribute("researchareas",lista);
  </code></pre>
  
  <p>Then i create a POST method to send this data.</p>
  
  <p>Question:How can i add in the form the data from the list(into a listbox)?How i can take back the values that the user will select?</p>