title: How can I get an input date from a form in a controller in spring?
body: <p>I'm trying to do a form for an user and I have a input birthdate of type date:</p>
  
  <pre><code>&lt;input type="date" class="form-control" th:field="*{birthdate}"&gt;
  </code></pre>
  
  <p>My user entity has anything like:</p>
  
  <pre><code>@Entity
  @Table(name = "users")
  public class User implements Serializable {
      ...
  
      @Column(nullable = true)
      private Date birthdate;
      ...
  }
  </code></pre>
  
  <p>And in my controller I try to get the input this way:</p>
  
  <pre><code>@PostMapping("/admin/user/{userId}")
      public String submitModUser(Model model, @Valid User user)
  </code></pre>
  
  <p>But user.getBirthdate() is always null. Anybody knows why? I suspect that the form send it in string with my locale FR, and my controller can't transform it to java.util.Date.</p>
  
  <p>Thanks</p>