title: Thymeleaf: how to include page specific javascript using layouts?
body: <p>Using thymeleaf is there a way to decorate my layout w/ my page specific javascript and javascript includes?</p>
  
  <pre><code>&lt;!--My Layout --&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div th:replace="fragments/header :: header"&gt;
  
  &lt;/div&gt;
  &lt;div class="container"&gt;
      &lt;div layout:fragment="content"&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;!--My Page --&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html layout:decorator="layout"&gt;
  &lt;head&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div layout:fragment="content"&gt;
      hello world
  &lt;/div&gt;
  
  &lt;script src="pageSpecific1.js"&gt;&lt;/script&gt;
  &lt;script src="pageSpecific2.js"&gt;&lt;/script&gt;
  &lt;script&gt;
   alert("hello world")
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>