title: How correctly use the Spring MVC <form:select> tag to show the value of a specific object field into a collection?
body: <p>I am pretty new in Spring MVC and I have some difficulties to understand how exactly works the <strong></strong> tag.</p>
  
  <p>So I have the following situation.</p>
  
  <p>Into a controller I have this method:</p>
  
  <pre><code>@RequestMapping(value = "/consultazioneMinisteriale", method = RequestMethod.GET)
  public String consultazione(Locale locale, Model model) {
  
      List&lt;Twb1012Regione&gt; listaRegioni = geograficaService.getListaRegioni();
  
      System.out.println("Numero regioni: " + listaRegioni.size());
  
      model.addAttribute("listaRegioni", listaRegioni);
  
      return "utenteMinisteriale/consultazione";
  }
  </code></pre>
  
  <p>As you can see this method retrieve a List of <strong>Twb1012Regione</strong> object and put it into the model object so it will be available into the <strong>consultazione.jsp</strong> page.</p>
  
  <p>So the <strong>Twb1012Regione</strong> class is a model object like this:</p>
  
  <pre><code>@Entity
  @Table(name="anagrafiche.TWB1012_REGIONE")
  @NamedQuery(name="Twb1012Regione.findAll", query="SELECT t FROM Twb1012Regione t")
  public class Twb1012Regione implements Serializable {
      private static final long serialVersionUID = 1L;
  
      @Id
      @Column(name="COD_REG")
      private String codReg;
  
      @Column(name="DES_REG")
      private String desReg;
  
      .....................................
      .....................................
      OTHER FIELDS
      .....................................
      .....................................
  }
  </code></pre>
  
  <p>Where the <strong>codReg</strong> field univocally identify the object and the <strong>desReg</strong> contain the value that I want to show as value into the <strong></strong> tag.</p>
  
  <p>Finnaly this is the code of my <strong>consultazione.jsp</strong> view:</p>
  
  <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%&gt;
  &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %&gt;
  &lt;%@ page session="false"%&gt;
  &lt;%@  taglib prefix="security" uri="http://www.springframework.org/security/tags" %&gt;
  &lt;%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Home&lt;/title&gt;
      &lt;/head&gt;
  
      &lt;body class="azure"&gt;
          &lt;h1&gt;Hello World&lt;/h1&gt;
  
          &lt;!--  &lt;div&gt; ${listaRegioni} &lt;/div&gt; --&gt;
  
  
          &lt;div&gt;
              &lt;label&gt;Regioni:&lt;/label&gt;
              &lt;form:select path="listaRegioni" items="${listaRegioni}"/&gt;
          &lt;/div&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The problem is that doing in this way I obtain the select dropdown but it show the <strong>reference of all my Twb1012Regione objects</strong> and not the name of the <strong>desReg</strong> field.</p>
  
  <p>This is the HTML rendered output:</p>
  
  <pre><code>&lt;select&gt;
      &lt;option value="it.myCompany.myProject.anagrafiche.Twb1012Regione@5a259924"&gt;it.myCompany.myProject.anagrafiche.Twb1012Regione@5a259924&lt;/option&gt;
      &lt;option value="it.myCompany.myProject.anagrafiche.Twb1012Regione@4a87c8d3"&gt;it.myCompany.myProject.anagrafiche.Twb1012Regione@4a87c8d3&lt;/option&gt;
      &lt;option value="it.myCompany.myProject.anagrafiche.Twb1012Regione@815b53a"&gt;it.myCompany.myProject.anagrafiche.Twb1012Regione@815b53a&lt;/option&gt;
      .................................................
      .................................................
      .................................................
  &lt;/select&gt;
  </code></pre>
  
  <p>Why? What am I missing? How can I shoe the value of the <strong>desReg</strong> field of each <strong>Twb1012Regione</strong> instead the reference of the objects?</p>
  
  <p><strong>EDIT-1:</strong> </p>
  
  <p>I tryied to change into:</p>
  
  <pre><code>&lt;form:select path="regioni"&gt;
     &lt;form:options items="${listaRegioni}" itemLabel="desReg" itemValue="codReg" /&gt;
  &lt;/form:select&gt;
  </code></pre>
  
  <p>But now when the page is rendered I obtain this error message into my stacktrace:</p>
  
  <pre><code>12:44:52,112 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/WIFIPNSD].[jsp]] (http-localhost/127.0.0.1:8080-4) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'regioni' available as request attribute
  </code></pre>
  
  <p>Why? What is wrong? How can I solve it?</p>