title: Spring MVC: Show data in a table row?
body: <p>I am trying to display <code>data</code> in a <code>table row</code>. However it is just showing the <code>var name</code> as output, e.g:</p>
  
  <pre><code>Name | age
  User1| {age}
  </code></pre>
  
  <p>I am using <code>Spring-MVC</code> along with <code>Spring Boot</code>. I have created other mapping classes and their data is showing correctly in <code>HTML &lt;p&gt; tags</code>. </p>
  
  <p><strong>My Controller:</strong></p>
  
  <pre><code>@Controller
  public class MyController {
  
      @RequestMapping("/age")
      public String age(@RequestParam(value="age", required=false, defaultValue="5") String age, Model model) {
          model.addAttribute("age", age);
          return "age";
      }
  }
  </code></pre>
  
  <p><strong>age.html: (uses ThymeLeaf)</strong></p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html xmlns:th="http://www.thymeleaf.org"&gt;
  &lt;head&gt;
      &lt;title&gt;Age Table&lt;/title&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;table border="1"&gt;
      &lt;tr&gt;
          &lt;td&gt;Name&lt;/td&gt;
          &lt;td&gt;Age&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;User1&lt;/td&gt;
          &lt;td&gt;${age}&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>