title: Thymeleaf: Template not accessible downloading a PDF online with Spring Boot 2.0.3
body: <p>I'm downloading a PDF file with a web app, developed with Spring Boot 2.0.3 and using Thymeleaf, from an admin section, protected with Spring Security. <strong>Locally it works fine, but online I get this error</strong>:</p>
  
  <p><code>org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/email/confirmedbooking", template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause</code></p>
  
  <p>This is the controller:</p>
  
  <pre><code>@GetMapping("/admin/bookings/booking-pdf")
  public void generatePdfBooking(@RequestParam Long idbooking, HttpServletResponse response)
                                 throws IOException, Exception{
  
      bookingService.setBookingService(idbooking);
      Booking booking = bookingService.getBooking();
      Guest guest = bookingService.getGuest();
  
      String idlanguage;
      if(guest.getIdlanguage() != null){
          idlanguage = guest.getIdlanguage();
      } else {idlanguage = "en";}
  
      Map&lt;String, Object&gt; map = new HashMap&lt;&gt;();
      map.put("booking", booking);
      map.put("guest", guest);
  
      byte[] data = pdfGenerator.createPdf("/email/confirmedbooking", map, idlanguage);
  
      pdfGenerator.streamReport(response, data, "id-" + booking.getIdbooking() + ".pdf");
  }
  </code></pre>
  
  <p>This is an extract of the html page:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns:th="http://www.thymeleaf.org"&gt;
  
  &lt;head&gt;
      &lt;link rel="stylesheet" href="/webjars/bootstrap /css/bootstrap.min.css"/&gt;
      &lt;link rel="stylesheet" href="/css/rentalwebs.css"/&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;table style="width:680px" class="table table-borderless"&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;h2 th:text="${property.name}"&gt;&lt;/h2&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;span th:text="#{booking.id}"&gt;&lt;/span&gt;
                      &lt;span th:text="${booking.idbooking}"&gt;&lt;/span&gt;
                      ....
  </code></pre>
  
  <p>As a template generator I'm using org.xhtmlrenderer.pdf.ITextRenderer (flying-saucer-pdf).</p>
  
  <p>I've tested providing different .html files to generate the PDF at <code>pdfGenerator.createPdf("/email/confirmedbooking", map, idlanguage);</code>, but the result is always the same.</p>