title: Change Spring-boot static web resources location?
body: <p>Base on this tutorial:</p>
  
  <p><a href="http://spring.io/guides/gs/serving-web-content/" rel="noreferrer">http://spring.io/guides/gs/serving-web-content/</a></p>
  
  <p>I can use the thymeleaf to serve the view in the location</p>
  
  <pre><code>/src/main/resources/templates/
  </code></pre>
  
  <p>However, I have to put the static web contents (css, js) in another location:</p>
  
  <pre><code>/src/main/webapp/resources
  </code></pre>
  
  <p>And linking the resources in the <strong>hello.html</strong> like that:</p>
  
  <pre><code>&lt;link href="resources/hello.css" /&gt;
  &lt;script src="resources/hello.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>The directory structure is:</p>
  
  <pre><code>└── src
      └── main
          └── java
              └── hello.java
          └──resources
              └──templates
                 └──hello.html
          └──webapp
              └──resources
                 └──hello.js
                 └──hello.css
  </code></pre>
  
  <p>The problem is that the links of the static files are work when I run the web server. But if I open the <strong>html</strong> files in offline mode, the links are broken.</p>
  
  <p>Could I move the static resource from</p>
  
  <pre><code>/src/main/webapp/resources
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>/src/main/resources/templates/resources
  </code></pre>
  
  <p>The new directory structure would be like:</p>
  
  <pre><code>└── src
      └── main
          └── java
              └── hello.java
          └──resources
              └──templates
                 └──hello.html
                 └──resources
                    └──hello.js
                    └──hello.css
  </code></pre>
  
  <p>I tried it but is doesn't work.</p>