title: Spring Boot search data between two dates
body: <p>I would like to search data between two date here is my repository</p>
  
  <pre><code>@Query("select mvt from Mouvements mvt where mvt.dateCompte between :x and :y")
  public Page&lt;Mouvements&gt; getMouvementsByDate(@Param("x")LocalDate dateBefore, @Param("y")LocalDate dateAfter, Pageable pageable); 
  </code></pre>
  
  <p>and here is my controller</p>
  
  <pre><code>@RequestMapping(value="/movementsByDate", method = RequestMethod.GET)
  public Page&lt;Mouvements&gt; movementsByDate(
          @RequestParam(name= "dateBefore", defaultValue="")LocalDate dateBefore, 
          @RequestParam(name= "dateAfter", defaultValue="")LocalDate dateAfter, 
          @RequestParam(name= "page", defaultValue="0")int page, 
          @RequestParam(name= "size", defaultValue="5")int size){
      return mouvementsRepository.getMouvementsByDate(dateBefore, dateAfter, new PageRequest(page, size));
  }
  </code></pre>
  
  <p>Now my problem is when I test this webservice with this url:</p>
  
  <pre><code>http://localhost:8080/api/movement/movementsByDate?dateBefore=27/11/2015&amp;dateAfter=03/01/2019&amp;page=0&amp;size=9
  </code></pre>
  
  <p>I have this error </p>
  
  <pre><code>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 java.time.LocalDate] for value '27/11/2015'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [27/11/2015]",
  </code></pre>