title: Thymeleaf not displaying values from spring controller
body: <p>I am practising thymeleaf template engine for the first time. I have followed the tutorial and so on but I have no idea where I am going wrong.</p>
  
  <p>My controller:</p>
  
  <pre><code>public String mainPage(Model model){
      model.addAttribute("data", "Hello Thymeleaf");  
      return "main";
  }
  </code></pre>
  
  <p>and my html is as follows:</p>
  
  <pre><code>&lt;!DOCTYPE html &gt;
  &lt;html xmlns:th="http://www.thymeleaf.org"&gt;
  
  &lt;head&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
     &lt;h1&gt;th:text="${data}"&lt;/h1&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I hit localhost it displays th:text="${data}" instead of Hello Thymeleaf</p>
  
  <pre><code>&lt;h1&gt;"${data}"&lt;/h1&gt;
  </code></pre>
  
  <p>doesn't work either. View resolver config must be correct as it resolves main to main.html. I am using spring4 SpringTemplateEngine and spring4 thymeleaf view resolver.</p>
  
  <p>thanks in advance</p>