title: why Thymeleaf's th:text not working in my Spring project?
body: <p>I have included Thymeleaf for my Spring project for the first time and want to create a simple project(display one word using th:text). But I get nothing in my html page. Why?</p>
  
  <p><strong>Greeting.java</strong></p>
  
  <pre><code>package com.supermegaproject.Main;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.web.bind.annotation.GetMapping;
  
  @Controller
  public class Greeting
  {
      @GetMapping("/")
      public String getMessage(Model model)
      {
          model.addAttribute("name", "John");
          return "mainPage";
      }
  }
  </code></pre>
  
  <p><strong>mainPage.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns:th="http://www.thymeleaf.org"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
      &lt;title&gt;Title&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h1&gt;Main Page&lt;/h1&gt; // DOES APPEAR
  
  &lt;h1 th:text="${name}"&gt;&lt;/h1&gt; // DOESN'T APPEAR AT ALL
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>At first I thought it may be because of build.gradle. But after checking it looks ok, thymeleaf included, so I don't know why then.</p>
  
  <pre><code>compile('org.springframework.boot:spring-boot-starter-thymeleaf')
  </code></pre>
  
  <p>Thank you in advance.</p>