title: Spring Boot 2.1.5 Failed to convert property value of type java.lang.String to required type java.time.LocalDate
body: <p>I am attempting set up a Spring Boot 2.1.5 / Spring MVC app using Thymeleaf as my template engine. I have a bean that will be backing my form (getters and setters omitted for brevity):</p>
  
  <pre><code> public class SchoolNightForm {
  
      private String orgName;
      private String address;
      private String location;
      private String city;
      private String state;
      private String zip;
      private String contactName;
      private String phone;
  
      @NotEmpty(message = "Enter a valid email.")
      private String email;
  
      @Positive(message = "Value must be positive.")
      private int totalStudents;
  
      private LocalDate dateRequested;
  }
  </code></pre>
  
  <p>The HTML template:</p>
  
  <pre><code>  &lt;div class='form-group col-sm-9'&gt;
                  &lt;label for='dateRequested'&gt;Date Requested&lt;/label&gt;
                  &lt;input type='date'  required class='form-control' id='dateRequested' name='dateRequested'
                      th:field='*{dateRequested}' /&gt;
                      &lt;small class='text-danger' th:if="${#fields.hasErrors('dateRequested')}" th:errors='*{dateRequested}'&gt;Valid date required&lt;/small&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>Per the <a href="https://www.thymeleaf.org/doc/tutorials/3.0/thymeleafspring.html#configuring-a-conversion-service" rel="nofollow noreferrer">Thymeleaf docs</a>, I configured a conversion service:</p>
  
  <pre><code>    @Configuration
  public class WebConfig implements WebMvcConfigurer {
  
      @Override
      public void addFormatters(FormatterRegistry registry) {
          registry.addFormatter(dateFormatter());
      }
  
      @Bean
      public DateFormatter dateFormatter() {
          return new DateFormatter("yyyy-MM-dd");
      }
  }
  </code></pre>
  
  <p>I initially used the default DateFormatter implementation (no String format provided), but, after, reviewing the error message, and seeing the format that the form was passing to the controller, I modified it accordingly:</p>
  
  <pre><code>Failed to convert property value of type java.lang.String to required type java.time.LocalDate for property dateRequested; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.time.LocalDate] for value 2019-05-28; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [2019-05-28]
  </code></pre>
  
  <p>My controller methods:</p>
  
  <pre><code>@GetMapping(value = "school-night")
  public String getSchoolNight(Model model) {
      model.addAttribute("schoolNightForm", new SchoolNightForm());
      return "bk-school-night";
  }
  
  @PostMapping(value = "school-night")
  public String postSchoolNigh(@Valid SchoolNightForm schoolNightForm, BindingResult result)
          throws MessagingException {
      if (result.hasErrors()) {
          return "bk-school-night";
      }
      emailService.schoolNightFotm(schoolNightForm);
      return "confirm";
  }
  </code></pre>
  
  <p>This error occurs during the post request. Any advice would be appreciated.</p>