title: Thymeleaf HREF server context
body: <p>I have a basic SpringBoot 2.0.4.RELEASE app. using Spring Initializer, JPA, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file.</p>
  
  <p>I have this href in a button that is working fine</p>
  
  <pre><code>&lt;input type="button" value="CANCEL" th:onclick="'window.location.href = \'' + @{/user/list/} + '\''"  /&gt;
  </code></pre>
  
  <p>nevertheless I have a href, where I have to put also the <code>server.servlet.context-path</code> defined the the <code>application.properties</code> file, otherwise the link goes to <code>http://127.0.0.1/user/list</code></p>
  
  <pre><code> &lt;a href="/myapp/user/list" class="pure-menu-link"&gt;
                         &lt;i class="fa fa-id-card-o fa-lg fa-fw"&gt;&lt;/i&gt;&amp;nbsp; USERS
                     &lt;/a&gt;
  </code></pre>