title: Hi, I want fill an select of html with thyleaf and appears an Error
body: <p>I want to fill a select with a Map as ModelAttribute but when I execute the app and try load my load appears a error.</p>
  <p><code>java.lang.IllegalStateException: Invalid target for Validator [com.bolsadeideas.springboot.form.app.validation.UserValidator@2343043c]: España at org.springframework.validation.DataBinder.assertValidators(DataBinder.java:542) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE] at org.springframework.validation.DataBinder.addValidators(DataBinder.java:553) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE] at com.bolsadeideas.springboot.form.app.controller.FormController.initBinder(FormController.java:54) ~[classes/:na]</code></p>
  <p>My html is this</p>
  <pre><code>&lt;form th:action=&quot;@{/form}&quot; method=&quot;post&quot; th:object=&quot;${user}&quot;&gt;
      &lt;div&gt;
          &lt;label for=&quot;country&quot;&gt;Country&lt;/label&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;select id=&quot;country&quot; th:field=&quot;*{country}&quot;&gt;
              &lt;option value=&quot;&quot;&gt;--Select Country--&lt;/option&gt;
              &lt;option th:each=&quot;country: ${countriesMap.entrySet()}&quot;
                  th:text=&quot;${country.value}&quot; th:value=&quot;${country.key}&quot;&gt;&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;div th:if=&quot;${#fields.hasErrors('country')}&quot; th:errors=&quot;*{country}&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>and my controller code:</p>
  <pre><code>@InitBinder // elemento del ciclo de vida del controlador
  public void initBinder(WebDataBinder binder) {
  
      binder.addValidators(validator);
      // CustomEditor cuztomizar un campo que obtemenos y convertirlo en otro tipo de
      // dato es como un filtro
      SimpleDateFormat dateFormat = new SimpleDateFormat(&quot;yyyy-MM-dd&quot;);
      // Eso es la indulgencia, es decir, define si en analizdor que va a realizar un
      // análisis un (parse) de la fecha con false se vuelve mas estricto
      dateFormat.setLenient(false);
      binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
  
  }// llenando la vista Select con un Map
  @ModelAttribute(&quot;countriesMap&quot;)
  public Map&lt;String, String&gt; countriesMap() {
      Map&lt;String, String&gt; countries = new HashMap&lt;String, String&gt;();
      countries.put(&quot;ES&quot;, &quot;España&quot;);
      countries.put(&quot;MX&quot;, &quot;México&quot;);
      countries.put(&quot;CL&quot;, &quot;Chile&quot;);
      countries.put(&quot;EC&quot;, &quot;Ecuador&quot;);
      countries.put(&quot;CO&quot;, &quot;Colombia&quot;);
      countries.put(&quot;BO&quot;, &quot;Bolivia&quot;);
      countries.put(&quot;FR&quot;, &quot;Francia&quot;);
      return countries;
  }
  </code></pre>
  <p>before I did not have problems using a simple List of java.util</p>