title: thymeleaf: Static resources are not loading in while using layouts
body: <p>My directory structure is </p>
  
  <p><strong>Directory structure</strong></p>
  
  <pre><code>src/
    main/
      resources/
          static/
               CSS/
               JS/
               images/
  
          template/
             fragments/
                           header.html
                           footer.html
                           navBar.html
              layouts/
                           appLayout.html
                           baseLayout.html
                   welcome.html
  </code></pre>
  
  <p><strong>appLayout.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns:th="http://www.thymeleaf.org"
        xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"&gt;
  
  &lt;head&gt;
          &lt;link rel="stylesheet" type="text/css" media="screen, projection" 
        href="/static/css/bootstrap.css" 
        th:href="@{/bootstrap.min.css}" /&gt;
  
    &lt;link rel="stylesheet" type="text/css" media="screen, projection" 
        href="/static/css/bootstrap.css" 
        th:href="@{/css/bootstrap.min.css}" /&gt;
  
  
    &lt;link rel="stylesheet" type="text/css" media="screen, projection" 
        href="/static/css/bootstrap.css" 
        th:href="@{css/bootstrap.min.css}" /&gt;
  
  
     &lt;link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap.min.css"
          th:href="@{/webjars/bootstrap/2.3.0/css/bootstrap.min.css}" rel="stylesheet" /&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div th:replace="/fragments/header :: header"&gt;&lt;/div&gt;
  &lt;div th:replace="/fragments/navbar :: navbar"&gt;&lt;/div&gt;
  &lt;div class="container"&gt;
      &lt;div layout:fragment="content"&gt;
      &lt;p&gt;Content goes here...&lt;/p&gt;
      &lt;/div&gt;
      &lt;footer&gt;
      &lt;div th:replace="/fragments/footer :: footer"&gt;&lt;/div&gt;
      &lt;/footer&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please do check the <code>&lt;links&gt;</code> tag in above layout, I have used different locations to the link tag, none giving the <code>404 error</code> why is it so?</p>
  
  <p><a href="https://i.stack.imgur.com/EtYI5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EtYI5.png" alt="enter image description here"></a></p>
  
  <p>Please look the above image, I have css and js files in resources/static/css/ folder and JS is int /resources/static/js/ folder what is going wrong? why isn't chrome showing 404 error for some static resources?</p>