title: Sending requests with LocalDate type parameters
body: <p>I wanted to send request like this:</p>
  <ul>
  <li>http://localhost:8080/reports/daily?start_date=2018-03-22&amp;end_date=2018-03-24</li>
  </ul>
  <p>I have an error:</p>
  <blockquote>
  <p>&quot;2018-05-31 15:40:29.623 WARN 11496 --- [nio-8080-exec-5]
  .w.s.m.s.DefaultHandlerExceptionResolver : Failed to bind request
  element:
  org.springframework.web.method.annotation.MethodArgumentTypeMismatchException:
  Failed to convert value of type 'java.lang.String' to required type
  'java.time.LocalDate'; nested exception is
  org.springframework.core.convert.ConversionFailedException: Failed to
  convert from type [java.lang.String] to type
  [@org.springframework.web.bind.annotation.RequestParam
  @org.springframework.format.annotation.DateTimeFormat
  java.time.LocalDate] for value '2018-03-22'; nested exception is
  java.lang.IllegalArgumentException: Parse attempt failed for value
  [2018-03-22] &quot;</p>
  </blockquote>
  <p>The problem is obvious so I found the solution and I changed everything. My method:</p>
  <pre><code>@RequestMapping(path = &quot;reports/daily&quot;, method = RequestMethod.GET, 
                  consumes = MediaType.APPLICATION_JSON_VALUE)
  public String getDailyReport(@RequestParam (&quot;start_date&quot;) 
                               @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) 
                               LocalDate startDate, 
                               @RequestParam(&quot;end_date&quot;) 
                               @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) 
                               LocalDate endDate) {
      double totalDistance = 0.0;
      double totalPrice = 0.0;
      List&lt;Transit&gt; transits = transitService.getTransits(startDate, endDate);
      for (Transit transit : transits) {
          if (transit.getDistance() != null &amp;&amp; transit.getPrice() != null) {
              try {
                  totalDistance = totalDistance + transit.getDistance();
                  totalPrice = totalPrice + transit.getPrice();
              } catch (NullPointerException e) {
                  e.fillInStackTrace().getMessage();
              }
          }
      }
      return &quot;Total distance &quot; + totalDistance + &quot;, total price: &quot; + totalPrice;
  }
  </code></pre>
  <p>For me everything seems fine, I also added needed dependecies to pom file.</p>