title: Thymeleaf templates - Is there a way to decorate a template instead of including a template fragment?
body: <p>I am working with Thymeleaf for the first time, and I need a clarification about the templates. If I correctly understand the documentation, I can <em>include</em> a template - or just a fragment of it - in my page. So for example, I can write something like that:</p>
  
  
  
  <pre class="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 th:include="template/layout :: header"&gt;
      &lt;/head&gt;
      &lt;body&gt;
          Hello world
          &lt;div th:include="template/layout :: footer"&gt;&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But what I want is in fact the opposite way of using the template : instead of including template fragment in the page, I want to include the page <strong>inside</strong> my template, something like that:</p>
  
  <pre class="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;/head&gt;
  &lt;body&gt;
  
      &lt;div id="my-template-header"&gt;...&lt;/div&gt;
  
      &lt;div id="the-content"&gt;
          &lt;!-- include here the content of the current page visited by the user --&gt;
          ???
      &lt;/div&gt;
  
      &lt;div id="my-template-footer"&gt;...&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>In others words, is there a way to have an equivalent of the <a href="http://wiki.sitemesh.org/display/sitemesh/Tag+References" rel="nofollow noreferrer">Sitemesh decorators tags</a> in Thymeleaf?</p>
  
  <p>Thanks</p>