title: Thymeleaf; "an error happened during template parsing"
body: <p>I´m currently having trouble with springboot and the error "An error happened during template parsing(template: "class path resource [templates/mainpage.html])".</p>
  
  <p>I´ve tried to reinstall different version of lombok because I though this might be the problem but nothing so far seemed to work. I´m using gradle with Eclipse as IDE.
  Any help is appreciated, found a few threads with the same problem due to different springBootVersions, but tried old and new ones and it didn´t fixed it for me either.</p>
  
  <p>My <strong>build.gradle</strong> looks like this:</p>
  
  <pre><code>buildscript {
  ext {
      springBootVersion = '2.0.3.RELEASE'
  }
  repositories {
      mavenCentral()
  }
  dependencies {
      classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  }
  }
  
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'org.springframework.boot'
  apply plugin: 'io.spring.dependency-management'
  
  group = 'test'
  version = '0.0.1-SNAPSHOT'
  sourceCompatibility = 1.8
  
  repositories {
   mavenCentral()
  }
  
  dependencies {
    compile('org.springframework.boot:spring-boot-starter-thymeleaf')
    compile('org.springframework.boot:spring-boot-starter-web')
    runtime('org.springframework.boot:spring-boot-devtools')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    compileOnly 'org.projectlombok:lombok:1.18.2'
  }
  </code></pre>
  
  <p>My <strong>Controller</strong>:</p>
  
  <pre><code>package test;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.PostMapping;
  
  @Controller
  public class ExampleController {
  
      @GetMapping(path = "/")
      public String mainpage(Model model) {
          return "mainpage";
      }
  
      @PostMapping(path = "/")
      public String calculate(Model model, Calc cal) {
          model.addAttribute("cal", cal);
          return "mainpage";
      }
  }
  </code></pre>
  
  <p>The <strong>Calc.java</strong> file with lombok:</p>
  
  <pre><code>@Data
  public class Calc {
  
      private Long val1;
      private Long val2;
  
      public Long getSum() {
          return this.val1 + this.val2;
      }
  }
  </code></pre>
  
  <p>And my <strong>mainpage.html</strong>:</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;html&gt;
      &lt;title&gt;Homepage&lt;/title&gt; 
      &lt;body&gt;
          &lt;form method="post"&gt;
              &lt;input type="text" name="val1" th:value="${cal.val1}"&gt; &lt;/input&gt;
              &lt;input type="text" name="val2" th:value="${cal.val2}"&gt; &lt;/input&gt;
              &lt;input type="submit"&gt;&lt;/input&gt; 
          &lt;/form&gt; 
          &lt;p th:text="| ${cal.val1} and ${cal.val2} equals ${cal.sum}|"&gt;&lt;/p&gt;
      &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>