title: How to select the value of a combo box in the controller in Spring MVC with Thymeleaf?
body: <p>I have the following code for the view.</p>
  <pre><code>&lt;input type=&quot;text&quot; name=&quot;person&quot; th:value=&quot;${person}&quot;&gt;
  
  &lt;select name=&quot;gender&quot; id=&quot;gender&quot; th:value=&quot;${gender}&quot;&gt;
      &lt;option value=&quot;Male&quot;&gt;Male&lt;/option&gt;
      &lt;option value=&quot;Female&quot;&gt;Female&lt;/option&gt;   
  &lt;/select&gt;
  </code></pre>
  <p>Controller</p>
  <pre><code>modelAndView.addObject(&quot;person&quot;, &quot;Nancy&quot;);
  modelAndView.addObject(&quot;gender&quot;, &quot;Female&quot;);
  </code></pre>
  <p>When this runs, the person field correctly displays &quot;Nancy&quot;.
  But the combo box displays male instead of female.
  How to make it show the correct value?</p>