title: Send start and end date in requestmapping in rest controller in spring boot
body: <p>i am fetching data from multiple tables in spring boot using hibernate jpa.
  My query is perfect and working fine, I am just stuck in how to pass start and date from rest controller and call in URL.
  Here is my rest controller code:</p>
  
  <pre><code>@RequestMapping("/employeeMonthlyAttendance/startDate/{startDate}/endDate/{endDate}")
  public String generateEmployeeMonthlyAttendanceReport(HttpServletResponse response, @PathVariable Date startDate, @PathVariable Date endDate){
  
      try {
          System.out.println("METHOD CALLED");
  
          List&lt;EmployeeMonthlyAttendanceReport&gt; employees = employeeMonthlyAttendanceReportService.getEmployeeMonthlyAttendance(startDate, endDate) ;
  
          // Get your data source
          JRBeanCollectionDataSource jrBeanCollectionDataSource = new JRBeanCollectionDataSource(employees);
  
          // Add parameters
  //            Map&lt;String, Object&gt; parameters = new HashMap&lt;&gt;();
  
  
          JasperPrint jasperPrint = null;
  
          //For Download PDF File
  //            response.setContentType("application/x-download");
  //            response.setHeader("Content-Disposition",   String.format("attachment; filename=\"All Sections Employees.pdf\""));
  
          //For  Direct View PDF FILE
          response.setContentType("application/pdf");
          response.setHeader("Content-Disposition", String.format("inline; filename=\"Employees Monthly Attendance Report.pdf\""));
  
          OutputStream out = response.getOutputStream();
          jasperPrint = jasperReportService.exportPDFFileWithData("EmployeeMonthlyAttendanceReport", new HashedMap(), jrBeanCollectionDataSource);
          JasperExportManager.exportReportToPdfStream(jasperPrint, out);
  
          System.out.println("Done");
  
          return "Report successfully generated";
      } catch (Exception e) {
          e.printStackTrace();
          return "Error--&gt; check the console log";
      }
  
  
  }
  </code></pre>