title: How to insert a fragment from another template
body: <p>Web project in java using thymeleaf.<br />
  I want to insert in a file:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot; xmlns:th=&quot;http://thymeleaf.org&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;title&gt;Title&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div th:fragment=&quot;srs-header&quot;&gt;
           header
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Here is this fragment:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot; xmlns:th=&quot;http://thymeleaf.org&quot;&gt;
  &lt;head&gt;
  &lt;!--    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;--&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div th:insert=&quot;books-header :: srs-header&quot;&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>As a result, I get the error: &quot;Whitelabel Error Page&quot;.<br />
  What am I doing wrong?</p>