title: Spring MVC controller with date
body: <p>I've been trying to use:</p>
  
  <pre><code>@RequestMapping(value="/consultaporusuarioperiodo/{idusuario}/{datainicio}/{datafim}", method = RequestMethod.GET)
  public String consultaPorPeriodoUsuario(
          @PathVariable("idusuario") Long idUsuario,
          @PathVariable("datainicio") Date dataInicio,
          @PathVariable("datafim") Date dataFim
          ,Model model) {
      Usuario usuario = usuarioService.buscaPorId(idUsuario);
      model.addAttribute("timesheet",timeSheetService.buscaPorPeriodoPorUsuario(dataInicio, dataFim,usuario));
      return "timesheetcrud/consultatimesheet";
  }
  </code></pre>
  
  <p>with this link:</p>
  
  <pre><code>http://localhost:8080/timesheet/consultaporusuarioperiodo/1/21012000/22012000
  </code></pre>
  
  <p>but I get this error:</p>
  
  <pre><code>HTTP Status 400 -
  
  type Status report
  
  message
  
  description The request sent by the client was syntactically incorrect ().
  
  Apache Tomcat/7.0.27
  </code></pre>
  
  <p>when I change to:</p>
  
  <pre><code>        @PathVariable("datainicio") String dataInicio,
          @PathVariable("datafim") String dataFim
  </code></pre>
  
  <p>It's work. What can I do to work with Date ?</p>
  
  <p>thanks</p>