title: Spring - Thymeleaf: Exception processing template
body: <p>I'm following the a book Spring in Action 5th ed., but I believe that is presents a bug.</p>
  
  <p>This is the GitHub of the book. I'm arrived on chap 3 tacos-jdbc
  <a href="https://github.com/habuma/spring-in-action-5-samples" rel="noreferrer">source of code</a></p>
  
  <p>When submit my order a sudden error appears:</p>
  
  <p><a href="https://i.stack.imgur.com/02PiM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/02PiM.png" alt="enter image description here"></a></p>
  
  <p>and in this way on the terminal:</p>
  
  <blockquote>
    <blockquote>
      <p>2019-05-25 16:58:18.164 ERROR 11777 --- [nio-8080-exec-7] org.thymeleaf.TemplateEngine             :
      [THYMELEAF][http-nio-8080-exec-7] Exception processing template
      "orderForm": An error happened during template parsing (template:
      "class path resource [templates/orderForm.html]")</p>
    </blockquote>
    
    <p>org.thymeleaf.exceptions.TemplateInputException: An error happened
    during template parsing (template: "class path resource
    [templates/orderForm.html]")</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/ktPhv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ktPhv.png" alt="enter image description here"></a></p>
  
  <p>OrderController:</p>
  
  <pre><code>@Controller
  @RequestMapping("/orders")
  @SessionAttributes("order")
  public class OrderController {
  
      private OrderRepository orderRepo;
  
      public OrderController(OrderRepository orderRepo) {
          this.orderRepo = orderRepo;
      }
  
      @GetMapping("/current")
      public String orderForm() {
          return "orderForm";
      }
  
      @PostMapping
      public String processOrder(@Valid Order order, Errors errors,
                                 SessionStatus sessionStatus) {
          if (errors.hasErrors()) {
              return "orderForm";
          }
  
          orderRepo.save(order);
          sessionStatus.setComplete();
  
          return "redirect:/";
      }
  
  }
  </code></pre>
  
  <p>and orderForm:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:th="http://www.thymeleaf.org"&gt;
  &lt;head&gt;
      &lt;title&gt;Taco Cloud&lt;/title&gt;
      &lt;link rel="stylesheet" th:href="@{/styles.css}" /&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;form method="POST" th:action="@{/orders}" th:object="${order}"&gt;
      &lt;h1&gt;Order your taco creations!&lt;/h1&gt;
  
      &lt;img th:src="@{/images/TacoCloud.png}"/&gt;
      &lt;a th:href="@{/design}" id="another"&gt;Design another taco&lt;/a&gt;&lt;br/&gt;
  
      &lt;div th:if="${#fields.hasErrors()}"&gt;
          &lt;span class="validationError"&gt;
          Please correct the problems below and resubmit.
          &lt;/span&gt;
      &lt;/div&gt;
  
      &lt;h3&gt;Deliver my taco masterpieces to...&lt;/h3&gt;
      &lt;label for="name"&gt;Name: &lt;/label&gt;
      &lt;input type="text" th:field="*{name}"/&gt;
      &lt;br/&gt;
  
      &lt;label for="street"&gt;Street address: &lt;/label&gt;
      &lt;input type="text" th:field="*{street}"/&gt;
      &lt;br/&gt;
  
      &lt;label for="city"&gt;City: &lt;/label&gt;
      &lt;input type="text" th:field="*{city}"/&gt;
      &lt;br/&gt;
  
      &lt;label for="state"&gt;State: &lt;/label&gt;
      &lt;input type="text" th:field="*{state}"/&gt;
      &lt;br/&gt;
  
      &lt;label for="zip"&gt;Zip code: &lt;/label&gt;
      &lt;input type="text" th:field="*{zip}"/&gt;
      &lt;br/&gt;
  
      &lt;label for="ccNumber"&gt;Credit Card #: &lt;/label&gt;
      &lt;input type="text" th:field="*{ccNumber}"/&gt;
      &lt;span class="validationError"
            th:if="${#fields.hasErrors('ccNumber')}"
            th:errors="*{ccNumber}"&gt;CC Num Error&lt;/span&gt;
  
      &lt;label for="ccExpiration"&gt;Expiration: &lt;/label&gt;
      &lt;input type="text" th:field="*{ccExpiration}"/&gt;
      &lt;br/&gt;
  
      &lt;label for="ccCVV"&gt;CVV: &lt;/label&gt;
      &lt;input type="text" th:field="*{ccCVV}"/&gt;
      &lt;br/&gt;
  
      &lt;input type="submit" value="Submit order"/&gt;
  &lt;/form&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>