title: Spring - Thymeleaf Date type
body: <p>I'm new at Spring and thymeleaf,so sorry for the silly question.</p>
  
  <p>I have a form that must filter some data based on a date that the user choose.
  I have this class:</p>
  
  <pre><code>public class RequestFilterEntity {
    private Date requestedAt;
    private Date dateScheduled;
    ...
   }
  </code></pre>
  
  <p>I have this endpoint in the controller:</p>
  
  <pre><code> @RequestMapping(value = "/requests", method = POST)
      public String filterRequests(RequestFilterEntity requestFilter, Model model) {
  
      model.addAttribute("requestFilter", new RequestFilterEntity());
  
      return "admin/reporting/filter_requests";
  }
  </code></pre>
  
  <p>and this View:</p>
  
  <pre><code> &lt;form method = "post" th:object="${requestFilter}" th:action="@{|/admin/reporting/requests|}"&gt;
  
      &lt;div class="form-group"&gt;
        &lt;label for="requested"&gt;Requested at &lt;/label&gt;
        &lt;input id="requested" type="date" class="form-control" th:field="*{requestedAt}"/&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I want that the object requestFilter that the Controller pass to the View will have the Date requestedAt set with the date chosen by the user (note that I am using input type="date") </p>
  
  <p>Does it make sense? I have an error into the view. Can someone help me out? Where is my mistake?</p>