title: Thymeleaf : relative url - without a webcontext
body: <p>I get this infamous error:</p>
  
  <blockquote>
    <p>cannot be context relative (/) or page relative unless you implement
    the IWebContext</p>
  </blockquote>
  
  <p>I have a spring boot application (without the web module) that creates pdf files.</p>
  
  <p>I am planning to use an HTML file as a template, but I could not link the css file nor the image properly due to these url issues.</p>
  
  <p>Html : </p>
  
  <pre><code>&lt;!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:th="http://www.thymeleaf.org"&gt;
  
    &lt;head&gt;
      &lt;title&gt;Company Invoice&lt;/title&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
      &lt;link rel="stylesheet" type="text/css" media="all" 
            href="./css/company.css" th:href="@{./css/company.css}"/&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;p th:utext="#{home.welcome}"&gt;Welcome !&lt;/p&gt;
       &lt;img src="/images/gtvglogo.png" th:src="@{/images/gtvglogo.png}"/&gt;
    &lt;/body&gt;    
  &lt;/html&gt;
  </code></pre>
  
  <p>folder structure:</p>
  
  <pre><code>src/main/resources/templates/sample.html
  src/main/resources/templates/css/sample.css
  </code></pre>
  
  <p>I googled a bit but I donT want to solve this via IWebContext.
  Is there another way?</p>
  
  <p>Thanks in advance.</p>